//================================================================================
//
// The Transvoxel Algorithm look-up tables
//
// Copyright 2009 by Eric Lengyel
//
// The following data originates from Eric Lengyel's Transvoxel Algorithm.
// http://transvoxel.org/
//
// The data in this file may be freely used in implementations of the Transvoxel
// Algorithm. If you do use this data, or any transformation of it, in your own
// projects, commercial or otherwise, please give credit by indicating in your
// source code that the data is part of the author's implementation of the
// Transvoxel Algorithm and that it came from the web address given above.
// (Simply copying and pasting the two lines of the previous paragraph would be
// perfect.) If you distribute a commercial product with source code included,
// then the credit in the source code is required.
//
// If you distribute any kind of product that uses this data, a credit visible to
// the end-user would be appreciated, but it is not required. However, you may
// not claim that the entire implementation of the Transvoxel Algorithm is your
// own if you use the data in this file or any transformation of it.
//
// The format of the data in this file is described in the dissertation "Voxel-
// Based Terrain for Real-Time Virtual Simulations", available at the web page
// given above. References to sections and figures below pertain to that paper.
//
// The contents of this file are protected by copyright and may not be publicly
// reproduced without permission.
//
//================================================================================

#include <core/error/error_macros.h>

namespace zylann::voxel::transvoxel::tables {

// The RegularCellData structure holds information about the triangulation
// used for a single equivalence class in the modified Marching Cubes algorithm,
// described in Section 3.2.

struct RegularCellData {
	unsigned char geometryCounts; // High nibble is vertex count, low nibble is triangle count.
	unsigned char vertexIndex[15]; // Groups of 3 indexes giving the triangulation.

	inline unsigned char get_vertex_index(unsigned int i) const {
#ifdef DEBUG_ENABLED
		CRASH_COND(i >= 15);
#endif
		return vertexIndex[i];
	}

	long GetVertexCount(void) const {
		return (geometryCounts >> 4);
	}

	long GetTriangleCount(void) const {
		return (geometryCounts & 0x0F);
	}
};

// The TransitionCellData structure holds information about the triangulation
// used for a single equivalence class in the Transvoxel Algorithm transition cell,
// described in Section 4.3.

struct TransitionCellData {
	long geometryCounts; // High nibble is vertex count, low nibble is triangle count.
	unsigned char vertexIndex[36]; // Groups of 3 indexes giving the triangulation.

	inline unsigned char get_vertex_index(unsigned int i) const {
#ifdef DEBUG_ENABLED
		CRASH_COND(i >= 36);
#endif
		return vertexIndex[i];
	}

	long GetVertexCount(void) const {
		return (geometryCounts >> 4);
	}

	long GetTriangleCount(void) const {
		return (geometryCounts & 0x0F);
	}
};

// The regularCellClass table maps an 8-bit regular Marching Cubes case index to
// an equivalence class index. Even though there are 18 equivalence classes in our
// modified Marching Cubes algorithm, a couple of them use the same exact triangulations,
// just with different vertex locations. We combined those classes for this table so
// that the class index ranges from 0 to 15.
// clang-format off
const unsigned char regularCellClass[256] = {
	0x00, 0x01, 0x01, 0x03, 0x01, 0x03, 0x02, 0x04, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x04, 0x03,
	0x01, 0x03, 0x02, 0x04, 0x02, 0x04, 0x06, 0x0C, 0x02, 0x05, 0x05, 0x0B, 0x05, 0x0A, 0x07, 0x04,
	0x01, 0x02, 0x03, 0x04, 0x02, 0x05, 0x05, 0x0A, 0x02, 0x06, 0x04, 0x0C, 0x05, 0x07, 0x0B, 0x04,
	0x03, 0x04, 0x04, 0x03, 0x05, 0x0B, 0x07, 0x04, 0x05, 0x07, 0x0A, 0x04, 0x08, 0x0E, 0x0E, 0x03,
	0x01, 0x02, 0x02, 0x05, 0x03, 0x04, 0x05, 0x0B, 0x02, 0x06, 0x05, 0x07, 0x04, 0x0C, 0x0A, 0x04,
	0x03, 0x04, 0x05, 0x0A, 0x04, 0x03, 0x07, 0x04, 0x05, 0x07, 0x08, 0x0E, 0x0B, 0x04, 0x0E, 0x03,
	0x02, 0x06, 0x05, 0x07, 0x05, 0x07, 0x08, 0x0E, 0x06, 0x09, 0x07, 0x0F, 0x07, 0x0F, 0x0E, 0x0D,
	0x04, 0x0C, 0x0B, 0x04, 0x0A, 0x04, 0x0E, 0x03, 0x07, 0x0F, 0x0E, 0x0D, 0x0E, 0x0D, 0x02, 0x01,
	0x01, 0x02, 0x02, 0x05, 0x02, 0x05, 0x06, 0x07, 0x03, 0x05, 0x04, 0x0A, 0x04, 0x0B, 0x0C, 0x04,
	0x02, 0x05, 0x06, 0x07, 0x06, 0x07, 0x09, 0x0F, 0x05, 0x08, 0x07, 0x0E, 0x07, 0x0E, 0x0F, 0x0D,
	0x03, 0x05, 0x04, 0x0B, 0x05, 0x08, 0x07, 0x0E, 0x04, 0x07, 0x03, 0x04, 0x0A, 0x0E, 0x04, 0x03,
	0x04, 0x0A, 0x0C, 0x04, 0x07, 0x0E, 0x0F, 0x0D, 0x0B, 0x0E, 0x04, 0x03, 0x0E, 0x02, 0x0D, 0x01,
	0x03, 0x05, 0x05, 0x08, 0x04, 0x0A, 0x07, 0x0E, 0x04, 0x07, 0x0B, 0x0E, 0x03, 0x04, 0x04, 0x03,
	0x04, 0x0B, 0x07, 0x0E, 0x0C, 0x04, 0x0F, 0x0D, 0x0A, 0x0E, 0x0E, 0x02, 0x04, 0x03, 0x0D, 0x01,
	0x04, 0x07, 0x0A, 0x0E, 0x0B, 0x0E, 0x0E, 0x02, 0x0C, 0x0F, 0x04, 0x0D, 0x04, 0x0D, 0x03, 0x01,
	0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x0D, 0x01, 0x04, 0x0D, 0x03, 0x01, 0x03, 0x01, 0x01, 0x00
};
// clang-format on
inline unsigned char get_regular_cell_class(unsigned int i) {
#ifdef DEBUG_ENABLED
	CRASH_COND(i >= 256);
#endif
	return regularCellClass[i];
}

// The regularCellData table holds the triangulation data for all 16 distinct classes to
// which a case can be mapped by the regularCellClass table.
// clang-format off
const RegularCellData regularCellData[16] = {
	{ 0x00, {} },
	{ 0x31, { 0, 1, 2 } },
	{ 0x62, { 0, 1, 2, 3, 4, 5 } },
	{ 0x42, { 0, 1, 2, 0, 2, 3 } },
	{ 0x53, { 0, 1, 4, 1, 3, 4, 1, 2, 3 } },
	{ 0x73, { 0, 1, 2, 0, 2, 3, 4, 5, 6 } },
	{ 0x93, { 0, 1, 2, 3, 4, 5, 6, 7, 8 } },
	{ 0x84, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 5, 6, 7 } },
	{ 0x84, { 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7 } },
	{ 0xC4, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
	{ 0x64, { 0, 4, 5, 0, 1, 4, 1, 3, 4, 1, 2, 3 } },
	{ 0x64, { 0, 5, 4, 0, 4, 1, 1, 4, 3, 1, 3, 2 } },
	{ 0x64, { 0, 4, 5, 0, 3, 4, 0, 1, 3, 1, 2, 3 } },
	{ 0x64, { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5 } },
	{ 0x75, { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6 } },
	{ 0x95, { 0, 4, 5, 0, 3, 4, 0, 1, 3, 1, 2, 3, 6, 7, 8 } }
};
// clang-format on
inline const RegularCellData &get_regular_cell_data(unsigned int i) {
#ifdef DEBUG_ENABLED
	CRASH_COND(i >= 16);
#endif
	return regularCellData[i];
}

// The regularVertexData table gives the vertex locations for every one of the 256 possible
// cases in the modified Marching Cubes algorithm. Each 16-bit value also provides information
// about whether a vertex can be reused from a neighboring cell. See Section 3.3 for details.
// The low byte contains the indexes for the two endpoints of the edge on which the vertex lies,
// as numbered in Figure 3.7. The high byte contains the vertex reuse data shown in Figure 3.8.
// clang-format off
const unsigned short regularVertexData[256][12] = {
	{},
	{ 0x6201, 0x5102, 0x3304 },
	{ 0x6201, 0x2315, 0x4113 },
	{ 0x5102, 0x3304, 0x2315, 0x4113 },
	{ 0x5102, 0x4223, 0x1326 },
	{ 0x3304, 0x6201, 0x4223, 0x1326 },
	{ 0x6201, 0x2315, 0x4113, 0x5102, 0x4223, 0x1326 },
	{ 0x4223, 0x1326, 0x3304, 0x2315, 0x4113 },
	{ 0x4113, 0x8337, 0x4223 },
	{ 0x6201, 0x5102, 0x3304, 0x4223, 0x4113, 0x8337 },
	{ 0x6201, 0x2315, 0x8337, 0x4223 },
	{ 0x5102, 0x3304, 0x2315, 0x8337, 0x4223 },
	{ 0x5102, 0x4113, 0x8337, 0x1326 },
	{ 0x4113, 0x8337, 0x1326, 0x3304, 0x6201 },
	{ 0x6201, 0x2315, 0x8337, 0x1326, 0x5102 },
	{ 0x3304, 0x2315, 0x8337, 0x1326 },
	{ 0x3304, 0x1146, 0x2245 },
	{ 0x6201, 0x5102, 0x1146, 0x2245 },
	{ 0x6201, 0x2315, 0x4113, 0x3304, 0x1146, 0x2245 },
	{ 0x2315, 0x4113, 0x5102, 0x1146, 0x2245 },
	{ 0x5102, 0x4223, 0x1326, 0x3304, 0x1146, 0x2245 },
	{ 0x1146, 0x2245, 0x6201, 0x4223, 0x1326 },
	{ 0x3304, 0x1146, 0x2245, 0x6201, 0x2315, 0x4113, 0x5102, 0x4223, 0x1326 },
	{ 0x4223, 0x1326, 0x1146, 0x2245, 0x2315, 0x4113 },
	{ 0x4223, 0x4113, 0x8337, 0x3304, 0x1146, 0x2245 },
	{ 0x6201, 0x5102, 0x1146, 0x2245, 0x4223, 0x4113, 0x8337 },
	{ 0x4223, 0x6201, 0x2315, 0x8337, 0x3304, 0x1146, 0x2245 },
	{ 0x4223, 0x8337, 0x2315, 0x2245, 0x1146, 0x5102 },
	{ 0x5102, 0x4113, 0x8337, 0x1326, 0x3304, 0x1146, 0x2245 },
	{ 0x4113, 0x8337, 0x1326, 0x1146, 0x2245, 0x6201 },
	{ 0x6201, 0x2315, 0x8337, 0x1326, 0x5102, 0x3304, 0x1146, 0x2245 },
	{ 0x2245, 0x2315, 0x8337, 0x1326, 0x1146 },
	{ 0x2315, 0x2245, 0x8157 },
	{ 0x6201, 0x5102, 0x3304, 0x2315, 0x2245, 0x8157 },
	{ 0x4113, 0x6201, 0x2245, 0x8157 },
	{ 0x2245, 0x8157, 0x4113, 0x5102, 0x3304 },
	{ 0x5102, 0x4223, 0x1326, 0x2315, 0x2245, 0x8157 },
	{ 0x6201, 0x4223, 0x1326, 0x3304, 0x2315, 0x2245, 0x8157 },
	{ 0x6201, 0x2245, 0x8157, 0x4113, 0x5102, 0x4223, 0x1326 },
	{ 0x4223, 0x1326, 0x3304, 0x2245, 0x8157, 0x4113 },
	{ 0x4223, 0x4113, 0x8337, 0x2315, 0x2245, 0x8157 },
	{ 0x6201, 0x5102, 0x3304, 0x4223, 0x4113, 0x8337, 0x2315, 0x2245, 0x8157 },
	{ 0x8337, 0x4223, 0x6201, 0x2245, 0x8157 },
	{ 0x5102, 0x3304, 0x2245, 0x8157, 0x8337, 0x4223 },
	{ 0x5102, 0x4113, 0x8337, 0x1326, 0x2315, 0x2245, 0x8157 },
	{ 0x4113, 0x8337, 0x1326, 0x3304, 0x6201, 0x2315, 0x2245, 0x8157 },
	{ 0x5102, 0x1326, 0x8337, 0x8157, 0x2245, 0x6201 },
	{ 0x8157, 0x8337, 0x1326, 0x3304, 0x2245 },
	{ 0x2315, 0x3304, 0x1146, 0x8157 },
	{ 0x6201, 0x5102, 0x1146, 0x8157, 0x2315 },
	{ 0x3304, 0x1146, 0x8157, 0x4113, 0x6201 },
	{ 0x4113, 0x5102, 0x1146, 0x8157 },
	{ 0x2315, 0x3304, 0x1146, 0x8157, 0x5102, 0x4223, 0x1326 },
	{ 0x1326, 0x4223, 0x6201, 0x2315, 0x8157, 0x1146 },
	{ 0x3304, 0x1146, 0x8157, 0x4113, 0x6201, 0x5102, 0x4223, 0x1326 },
	{ 0x1326, 0x1146, 0x8157, 0x4113, 0x4223 },
	{ 0x2315, 0x3304, 0x1146, 0x8157, 0x4223, 0x4113, 0x8337 },
	{ 0x6201, 0x5102, 0x1146, 0x8157, 0x2315, 0x4223, 0x4113, 0x8337 },
	{ 0x3304, 0x1146, 0x8157, 0x8337, 0x4223, 0x6201 },
	{ 0x4223, 0x5102, 0x1146, 0x8157, 0x8337 },
	{ 0x2315, 0x3304, 0x1146, 0x8157, 0x5102, 0x4113, 0x8337, 0x1326 },
	{ 0x6201, 0x4113, 0x8337, 0x1326, 0x1146, 0x8157, 0x2315 },
	{ 0x6201, 0x3304, 0x1146, 0x8157, 0x8337, 0x1326, 0x5102 },
	{ 0x1326, 0x1146, 0x8157, 0x8337 },
	{ 0x1326, 0x8267, 0x1146 },
	{ 0x6201, 0x5102, 0x3304, 0x1326, 0x8267, 0x1146 },
	{ 0x6201, 0x2315, 0x4113, 0x1326, 0x8267, 0x1146 },
	{ 0x5102, 0x3304, 0x2315, 0x4113, 0x1326, 0x8267, 0x1146 },
	{ 0x5102, 0x4223, 0x8267, 0x1146 },
	{ 0x3304, 0x6201, 0x4223, 0x8267, 0x1146 },
	{ 0x5102, 0x4223, 0x8267, 0x1146, 0x6201, 0x2315, 0x4113 },
	{ 0x1146, 0x8267, 0x4223, 0x4113, 0x2315, 0x3304 },
	{ 0x4113, 0x8337, 0x4223, 0x1326, 0x8267, 0x1146 },
	{ 0x6201, 0x5102, 0x3304, 0x4223, 0x4113, 0x8337, 0x1326, 0x8267, 0x1146 },
	{ 0x6201, 0x2315, 0x8337, 0x4223, 0x1326, 0x8267, 0x1146 },
	{ 0x5102, 0x3304, 0x2315, 0x8337, 0x4223, 0x1326, 0x8267, 0x1146 },
	{ 0x8267, 0x1146, 0x5102, 0x4113, 0x8337 },
	{ 0x6201, 0x4113, 0x8337, 0x8267, 0x1146, 0x3304 },
	{ 0x6201, 0x2315, 0x8337, 0x8267, 0x1146, 0x5102 },
	{ 0x1146, 0x3304, 0x2315, 0x8337, 0x8267 },
	{ 0x3304, 0x1326, 0x8267, 0x2245 },
	{ 0x1326, 0x8267, 0x2245, 0x6201, 0x5102 },
	{ 0x3304, 0x1326, 0x8267, 0x2245, 0x6201, 0x2315, 0x4113 },
	{ 0x1326, 0x8267, 0x2245, 0x2315, 0x4113, 0x5102 },
	{ 0x5102, 0x4223, 0x8267, 0x2245, 0x3304 },
	{ 0x6201, 0x4223, 0x8267, 0x2245 },
	{ 0x5102, 0x4223, 0x8267, 0x2245, 0x3304, 0x6201, 0x2315, 0x4113 },
	{ 0x4113, 0x4223, 0x8267, 0x2245, 0x2315 },
	{ 0x3304, 0x1326, 0x8267, 0x2245, 0x4223, 0x4113, 0x8337 },
	{ 0x1326, 0x8267, 0x2245, 0x6201, 0x5102, 0x4223, 0x4113, 0x8337 },
	{ 0x3304, 0x1326, 0x8267, 0x2245, 0x4223, 0x6201, 0x2315, 0x8337 },
	{ 0x5102, 0x1326, 0x8267, 0x2245, 0x2315, 0x8337, 0x4223 },
	{ 0x3304, 0x2245, 0x8267, 0x8337, 0x4113, 0x5102 },
	{ 0x8337, 0x8267, 0x2245, 0x6201, 0x4113 },
	{ 0x5102, 0x6201, 0x2315, 0x8337, 0x8267, 0x2245, 0x3304 },
	{ 0x2315, 0x8337, 0x8267, 0x2245 },
	{ 0x2315, 0x2245, 0x8157, 0x1326, 0x8267, 0x1146 },
	{ 0x6201, 0x5102, 0x3304, 0x2315, 0x2245, 0x8157, 0x1326, 0x8267, 0x1146 },
	{ 0x6201, 0x2245, 0x8157, 0x4113, 0x1326, 0x8267, 0x1146 },
	{ 0x2245, 0x8157, 0x4113, 0x5102, 0x3304, 0x1326, 0x8267, 0x1146 },
	{ 0x4223, 0x8267, 0x1146, 0x5102, 0x2315, 0x2245, 0x8157 },
	{ 0x3304, 0x6201, 0x4223, 0x8267, 0x1146, 0x2315, 0x2245, 0x8157 },
	{ 0x4223, 0x8267, 0x1146, 0x5102, 0x6201, 0x2245, 0x8157, 0x4113 },
	{ 0x3304, 0x2245, 0x8157, 0x4113, 0x4223, 0x8267, 0x1146 },
	{ 0x4223, 0x4113, 0x8337, 0x2315, 0x2245, 0x8157, 0x1326, 0x8267, 0x1146 },
	{ 0x6201, 0x5102, 0x3304, 0x4223, 0x4113, 0x8337, 0x2315, 0x2245, 0x8157, 0x1326, 0x8267, 0x1146 },
	{ 0x8337, 0x4223, 0x6201, 0x2245, 0x8157, 0x1326, 0x8267, 0x1146 },
	{ 0x4223, 0x5102, 0x3304, 0x2245, 0x8157, 0x8337, 0x1326, 0x8267, 0x1146 },
	{ 0x8267, 0x1146, 0x5102, 0x4113, 0x8337, 0x2315, 0x2245, 0x8157 },
	{ 0x6201, 0x4113, 0x8337, 0x8267, 0x1146, 0x3304, 0x2315, 0x2245, 0x8157 },
	{ 0x8337, 0x8267, 0x1146, 0x5102, 0x6201, 0x2245, 0x8157 },
	{ 0x3304, 0x2245, 0x8157, 0x8337, 0x8267, 0x1146 },
	{ 0x8157, 0x2315, 0x3304, 0x1326, 0x8267 },
	{ 0x8267, 0x8157, 0x2315, 0x6201, 0x5102, 0x1326 },
	{ 0x8267, 0x1326, 0x3304, 0x6201, 0x4113, 0x8157 },
	{ 0x8267, 0x8157, 0x4113, 0x5102, 0x1326 },
	{ 0x5102, 0x4223, 0x8267, 0x8157, 0x2315, 0x3304 },
	{ 0x2315, 0x6201, 0x4223, 0x8267, 0x8157 },
	{ 0x3304, 0x5102, 0x4223, 0x8267, 0x8157, 0x4113, 0x6201 },
	{ 0x4113, 0x4223, 0x8267, 0x8157 },
	{ 0x8157, 0x2315, 0x3304, 0x1326, 0x8267, 0x4223, 0x4113, 0x8337 },
	{ 0x8157, 0x2315, 0x6201, 0x5102, 0x1326, 0x8267, 0x4223, 0x4113, 0x8337 },
	{ 0x8157, 0x8337, 0x4223, 0x6201, 0x3304, 0x1326, 0x8267 },
	{ 0x5102, 0x1326, 0x8267, 0x8157, 0x8337, 0x4223 },
	{ 0x8267, 0x8157, 0x2315, 0x3304, 0x5102, 0x4113, 0x8337 },
	{ 0x6201, 0x4113, 0x8337, 0x8267, 0x8157, 0x2315 },
	{ 0x6201, 0x3304, 0x5102, 0x8337, 0x8267, 0x8157 },
	{ 0x8337, 0x8267, 0x8157 },
	{ 0x8337, 0x8157, 0x8267 },
	{ 0x6201, 0x5102, 0x3304, 0x8337, 0x8157, 0x8267 },
	{ 0x6201, 0x2315, 0x4113, 0x8337, 0x8157, 0x8267 },
	{ 0x5102, 0x3304, 0x2315, 0x4113, 0x8337, 0x8157, 0x8267 },
	{ 0x5102, 0x4223, 0x1326, 0x8337, 0x8157, 0x8267 },
	{ 0x6201, 0x4223, 0x1326, 0x3304, 0x8337, 0x8157, 0x8267 },
	{ 0x6201, 0x2315, 0x4113, 0x5102, 0x4223, 0x1326, 0x8337, 0x8157, 0x8267 },
	{ 0x4223, 0x1326, 0x3304, 0x2315, 0x4113, 0x8337, 0x8157, 0x8267 },
	{ 0x4113, 0x8157, 0x8267, 0x4223 },
	{ 0x4223, 0x4113, 0x8157, 0x8267, 0x6201, 0x5102, 0x3304 },
	{ 0x8157, 0x8267, 0x4223, 0x6201, 0x2315 },
	{ 0x3304, 0x2315, 0x8157, 0x8267, 0x4223, 0x5102 },
	{ 0x1326, 0x5102, 0x4113, 0x8157, 0x8267 },
	{ 0x8157, 0x4113, 0x6201, 0x3304, 0x1326, 0x8267 },
	{ 0x1326, 0x5102, 0x6201, 0x2315, 0x8157, 0x8267 },
	{ 0x8267, 0x1326, 0x3304, 0x2315, 0x8157 },
	{ 0x3304, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 },
	{ 0x6201, 0x5102, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 },
	{ 0x6201, 0x2315, 0x4113, 0x3304, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 },
	{ 0x2315, 0x4113, 0x5102, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 },
	{ 0x5102, 0x4223, 0x1326, 0x3304, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 },
	{ 0x1146, 0x2245, 0x6201, 0x4223, 0x1326, 0x8337, 0x8157, 0x8267 },
	{ 0x6201, 0x2315, 0x4113, 0x5102, 0x4223, 0x1326, 0x3304, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 },
	{ 0x4113, 0x4223, 0x1326, 0x1146, 0x2245, 0x2315, 0x8337, 0x8157, 0x8267 },
	{ 0x4223, 0x4113, 0x8157, 0x8267, 0x3304, 0x1146, 0x2245 },
	{ 0x6201, 0x5102, 0x1146, 0x2245, 0x4223, 0x4113, 0x8157, 0x8267 },
	{ 0x8157, 0x8267, 0x4223, 0x6201, 0x2315, 0x3304, 0x1146, 0x2245 },
	{ 0x2315, 0x8157, 0x8267, 0x4223, 0x5102, 0x1146, 0x2245 },
	{ 0x1326, 0x5102, 0x4113, 0x8157, 0x8267, 0x3304, 0x1146, 0x2245 },
	{ 0x1326, 0x1146, 0x2245, 0x6201, 0x4113, 0x8157, 0x8267 },
	{ 0x5102, 0x6201, 0x2315, 0x8157, 0x8267, 0x1326, 0x3304, 0x1146, 0x2245 },
	{ 0x1326, 0x1146, 0x2245, 0x2315, 0x8157, 0x8267 },
	{ 0x2315, 0x2245, 0x8267, 0x8337 },
	{ 0x2315, 0x2245, 0x8267, 0x8337, 0x6201, 0x5102, 0x3304 },
	{ 0x4113, 0x6201, 0x2245, 0x8267, 0x8337 },
	{ 0x5102, 0x4113, 0x8337, 0x8267, 0x2245, 0x3304 },
	{ 0x2315, 0x2245, 0x8267, 0x8337, 0x5102, 0x4223, 0x1326 },
	{ 0x6201, 0x4223, 0x1326, 0x3304, 0x8337, 0x2315, 0x2245, 0x8267 },
	{ 0x4113, 0x6201, 0x2245, 0x8267, 0x8337, 0x5102, 0x4223, 0x1326 },
	{ 0x4113, 0x4223, 0x1326, 0x3304, 0x2245, 0x8267, 0x8337 },
	{ 0x2315, 0x2245, 0x8267, 0x4223, 0x4113 },
	{ 0x2315, 0x2245, 0x8267, 0x4223, 0x4113, 0x6201, 0x5102, 0x3304 },
	{ 0x6201, 0x2245, 0x8267, 0x4223 },
	{ 0x3304, 0x2245, 0x8267, 0x4223, 0x5102 },
	{ 0x5102, 0x4113, 0x2315, 0x2245, 0x8267, 0x1326 },
	{ 0x4113, 0x2315, 0x2245, 0x8267, 0x1326, 0x3304, 0x6201 },
	{ 0x5102, 0x6201, 0x2245, 0x8267, 0x1326 },
	{ 0x3304, 0x2245, 0x8267, 0x1326 },
	{ 0x8267, 0x8337, 0x2315, 0x3304, 0x1146 },
	{ 0x5102, 0x1146, 0x8267, 0x8337, 0x2315, 0x6201 },
	{ 0x3304, 0x1146, 0x8267, 0x8337, 0x4113, 0x6201 },
	{ 0x8337, 0x4113, 0x5102, 0x1146, 0x8267 },
	{ 0x8267, 0x8337, 0x2315, 0x3304, 0x1146, 0x5102, 0x4223, 0x1326 },
	{ 0x1146, 0x8267, 0x8337, 0x2315, 0x6201, 0x4223, 0x1326 },
	{ 0x8267, 0x8337, 0x4113, 0x6201, 0x3304, 0x1146, 0x5102, 0x4223, 0x1326 },
	{ 0x4113, 0x4223, 0x1326, 0x1146, 0x8267, 0x8337 },
	{ 0x3304, 0x2315, 0x4113, 0x4223, 0x8267, 0x1146 },
	{ 0x2315, 0x6201, 0x5102, 0x1146, 0x8267, 0x4223, 0x4113 },
	{ 0x1146, 0x8267, 0x4223, 0x6201, 0x3304 },
	{ 0x5102, 0x1146, 0x8267, 0x4223 },
	{ 0x8267, 0x1326, 0x5102, 0x4113, 0x2315, 0x3304, 0x1146 },
	{ 0x6201, 0x4113, 0x2315, 0x1326, 0x1146, 0x8267 },
	{ 0x6201, 0x3304, 0x1146, 0x8267, 0x1326, 0x5102 },
	{ 0x1326, 0x1146, 0x8267 },
	{ 0x1326, 0x8337, 0x8157, 0x1146 },
	{ 0x8337, 0x8157, 0x1146, 0x1326, 0x6201, 0x5102, 0x3304 },
	{ 0x8337, 0x8157, 0x1146, 0x1326, 0x6201, 0x2315, 0x4113 },
	{ 0x4113, 0x5102, 0x3304, 0x2315, 0x1326, 0x8337, 0x8157, 0x1146 },
	{ 0x8337, 0x8157, 0x1146, 0x5102, 0x4223 },
	{ 0x6201, 0x4223, 0x8337, 0x8157, 0x1146, 0x3304 },
	{ 0x8337, 0x8157, 0x1146, 0x5102, 0x4223, 0x6201, 0x2315, 0x4113 },
	{ 0x4223, 0x8337, 0x8157, 0x1146, 0x3304, 0x2315, 0x4113 },
	{ 0x4223, 0x4113, 0x8157, 0x1146, 0x1326 },
	{ 0x4223, 0x4113, 0x8157, 0x1146, 0x1326, 0x6201, 0x5102, 0x3304 },
	{ 0x1146, 0x8157, 0x2315, 0x6201, 0x4223, 0x1326 },
	{ 0x4223, 0x5102, 0x3304, 0x2315, 0x8157, 0x1146, 0x1326 },
	{ 0x4113, 0x8157, 0x1146, 0x5102 },
	{ 0x6201, 0x4113, 0x8157, 0x1146, 0x3304 },
	{ 0x2315, 0x8157, 0x1146, 0x5102, 0x6201 },
	{ 0x2315, 0x8157, 0x1146, 0x3304 },
	{ 0x2245, 0x3304, 0x1326, 0x8337, 0x8157 },
	{ 0x6201, 0x2245, 0x8157, 0x8337, 0x1326, 0x5102 },
	{ 0x2245, 0x3304, 0x1326, 0x8337, 0x8157, 0x6201, 0x2315, 0x4113 },
	{ 0x2245, 0x2315, 0x4113, 0x5102, 0x1326, 0x8337, 0x8157 },
	{ 0x4223, 0x8337, 0x8157, 0x2245, 0x3304, 0x5102 },
	{ 0x8157, 0x2245, 0x6201, 0x4223, 0x8337 },
	{ 0x2245, 0x3304, 0x5102, 0x4223, 0x8337, 0x8157, 0x4113, 0x6201, 0x2315 },
	{ 0x4223, 0x8337, 0x8157, 0x2245, 0x2315, 0x4113 },
	{ 0x4113, 0x8157, 0x2245, 0x3304, 0x1326, 0x4223 },
	{ 0x1326, 0x4223, 0x4113, 0x8157, 0x2245, 0x6201, 0x5102 },
	{ 0x8157, 0x2245, 0x3304, 0x1326, 0x4223, 0x6201, 0x2315 },
	{ 0x5102, 0x1326, 0x4223, 0x2315, 0x8157, 0x2245 },
	{ 0x3304, 0x5102, 0x4113, 0x8157, 0x2245 },
	{ 0x4113, 0x8157, 0x2245, 0x6201 },
	{ 0x5102, 0x6201, 0x2315, 0x8157, 0x2245, 0x3304 },
	{ 0x2315, 0x8157, 0x2245 },
	{ 0x1146, 0x1326, 0x8337, 0x2315, 0x2245 },
	{ 0x1146, 0x1326, 0x8337, 0x2315, 0x2245, 0x6201, 0x5102, 0x3304 },
	{ 0x6201, 0x2245, 0x1146, 0x1326, 0x8337, 0x4113 },
	{ 0x2245, 0x1146, 0x1326, 0x8337, 0x4113, 0x5102, 0x3304 },
	{ 0x5102, 0x1146, 0x2245, 0x2315, 0x8337, 0x4223 },
	{ 0x1146, 0x3304, 0x6201, 0x4223, 0x8337, 0x2315, 0x2245 },
	{ 0x8337, 0x4113, 0x6201, 0x2245, 0x1146, 0x5102, 0x4223 },
	{ 0x4223, 0x8337, 0x4113, 0x3304, 0x2245, 0x1146 },
	{ 0x4113, 0x2315, 0x2245, 0x1146, 0x1326, 0x4223 },
	{ 0x1146, 0x1326, 0x4223, 0x4113, 0x2315, 0x2245, 0x6201, 0x5102, 0x3304 },
	{ 0x1326, 0x4223, 0x6201, 0x2245, 0x1146 },
	{ 0x4223, 0x5102, 0x3304, 0x2245, 0x1146, 0x1326 },
	{ 0x2245, 0x1146, 0x5102, 0x4113, 0x2315 },
	{ 0x4113, 0x2315, 0x2245, 0x1146, 0x3304, 0x6201 },
	{ 0x6201, 0x2245, 0x1146, 0x5102 },
	{ 0x3304, 0x2245, 0x1146 },
	{ 0x3304, 0x1326, 0x8337, 0x2315 },
	{ 0x5102, 0x1326, 0x8337, 0x2315, 0x6201 },
	{ 0x6201, 0x3304, 0x1326, 0x8337, 0x4113 },
	{ 0x5102, 0x1326, 0x8337, 0x4113 },
	{ 0x4223, 0x8337, 0x2315, 0x3304, 0x5102 },
	{ 0x6201, 0x4223, 0x8337, 0x2315 },
	{ 0x3304, 0x5102, 0x4223, 0x8337, 0x4113, 0x6201 },
	{ 0x4113, 0x4223, 0x8337 },
	{ 0x4113, 0x2315, 0x3304, 0x1326, 0x4223 },
	{ 0x1326, 0x4223, 0x4113, 0x2315, 0x6201, 0x5102 },
	{ 0x3304, 0x1326, 0x4223, 0x6201 },
	{ 0x5102, 0x1326, 0x4223 },
	{ 0x5102, 0x4113, 0x2315, 0x3304 },
	{ 0x6201, 0x4113, 0x2315 },
	{ 0x6201, 0x3304, 0x5102 },
	{}
};
// clang-format on
inline unsigned short get_regular_vertex_data(unsigned int i, unsigned int j) {
#ifdef DEBUG_ENABLED
	CRASH_COND(i >= 256);
	CRASH_COND(j >= 12);
#endif
	return regularVertexData[i][j];
}

// The transitionCellClass table maps a 9-bit transition cell case index to an equivalence
// class index. Even though there are 73 equivalence classes in the Transvoxel Algorithm,
// several of them use the same exact triangulations, just with different vertex locations.
// We combined those classes for this table so that the class index ranges from 0 to 55.
// The high bit is set in the cases for which the inverse state of the voxel data maps to
// the equivalence class, meaning that the winding order of each triangle should be reversed.
// clang-format off
const unsigned char transitionCellClass[512] = {
	0x00, 0x01, 0x02, 0x84, 0x01, 0x05, 0x04, 0x04, 0x02, 0x87, 0x09, 0x8C, 0x84, 0x0B, 0x05, 0x05,
	0x01, 0x08, 0x07, 0x8D, 0x05, 0x0F, 0x8B, 0x0B, 0x04, 0x0D, 0x0C, 0x1C, 0x04, 0x8B, 0x85, 0x85,
	0x02, 0x07, 0x09, 0x8C, 0x87, 0x10, 0x0C, 0x0C, 0x09, 0x12, 0x15, 0x9A, 0x8C, 0x19, 0x90, 0x10,
	0x84, 0x8D, 0x8C, 0x9C, 0x0B, 0x9D, 0x0F, 0x0F, 0x05, 0x1B, 0x10, 0xAC, 0x05, 0x0F, 0x8B, 0x0B,
	0x01, 0x05, 0x87, 0x0B, 0x08, 0x0F, 0x0D, 0x8B, 0x07, 0x10, 0x12, 0x19, 0x8D, 0x9D, 0x1B, 0x0F,
	0x05, 0x0F, 0x10, 0x9D, 0x0F, 0x1E, 0x1D, 0xA1, 0x8B, 0x1D, 0x99, 0x32, 0x0B, 0xA1, 0x8F, 0x94,
	0x04, 0x8B, 0x0C, 0x0F, 0x0D, 0x1D, 0x1C, 0x8F, 0x0C, 0x99, 0x1A, 0x31, 0x1C, 0x32, 0x2C, 0xA7,
	0x04, 0x0B, 0x0C, 0x0F, 0x8B, 0xA1, 0x8F, 0x96, 0x85, 0x8F, 0x90, 0x27, 0x85, 0x94, 0x8B, 0x8A,
	0x02, 0x04, 0x09, 0x05, 0x07, 0x8B, 0x0C, 0x85, 0x09, 0x0C, 0x15, 0x90, 0x8C, 0x0F, 0x10, 0x8B,
	0x87, 0x0D, 0x12, 0x1B, 0x10, 0x1D, 0x99, 0x8F, 0x0C, 0x1C, 0x1A, 0x2C, 0x0C, 0x8F, 0x90, 0x8B,
	0x09, 0x0C, 0x15, 0x10, 0x12, 0x99, 0x1A, 0x90, 0x15, 0x1A, 0x23, 0x30, 0x9A, 0x31, 0x30, 0x19,
	0x8C, 0x1C, 0x9A, 0xAC, 0x19, 0x32, 0x31, 0x27, 0x90, 0x2C, 0x30, 0x29, 0x10, 0xA7, 0x19, 0x24,
	0x84, 0x04, 0x8C, 0x05, 0x8D, 0x0B, 0x1C, 0x85, 0x8C, 0x0C, 0x9A, 0x10, 0x9C, 0x0F, 0xAC, 0x0B,
	0x0B, 0x8B, 0x19, 0x0F, 0x9D, 0xA1, 0x32, 0x94, 0x0F, 0x8F, 0x31, 0xA7, 0x0F, 0x96, 0x27, 0x8A,
	0x05, 0x85, 0x90, 0x8B, 0x1B, 0x8F, 0x2C, 0x8B, 0x10, 0x90, 0x30, 0x19, 0xAC, 0x27, 0x29, 0x24,
	0x05, 0x85, 0x10, 0x0B, 0x0F, 0x94, 0xA7, 0x8A, 0x8B, 0x8B, 0x19, 0x24, 0x0B, 0x8A, 0x24, 0x83,
	0x03, 0x06, 0x0A, 0x8B, 0x06, 0x0E, 0x0B, 0x0B, 0x0A, 0x91, 0x14, 0x8F, 0x8B, 0x17, 0x05, 0x85,
	0x06, 0x13, 0x11, 0x98, 0x0E, 0x1F, 0x97, 0x2B, 0x0B, 0x18, 0x0F, 0x36, 0x0B, 0xAB, 0x05, 0x85,
	0x0A, 0x11, 0x16, 0x8F, 0x91, 0x20, 0x0F, 0x8F, 0x14, 0x22, 0x21, 0x1D, 0x8F, 0x2D, 0x0B, 0x8B,
	0x8B, 0x98, 0x8F, 0xB7, 0x17, 0xAE, 0x8C, 0x0C, 0x05, 0x2F, 0x8B, 0xB5, 0x85, 0xA6, 0x84, 0x04,
	0x06, 0x0E, 0x91, 0x17, 0x13, 0x1F, 0x18, 0xAB, 0x11, 0x20, 0x22, 0x2D, 0x98, 0xAE, 0x2F, 0xA6,
	0x0E, 0x1F, 0x20, 0xAE, 0x1F, 0x33, 0x2E, 0x2A, 0x97, 0x2E, 0xAD, 0x28, 0x2B, 0x2A, 0x26, 0x25,
	0x0B, 0x97, 0x0F, 0x8C, 0x18, 0x2E, 0x37, 0x8C, 0x0F, 0xAD, 0x9D, 0x90, 0x36, 0x28, 0x35, 0x07,
	0x0B, 0x2B, 0x8F, 0x0C, 0xAB, 0x2A, 0x8C, 0x89, 0x05, 0x26, 0x0B, 0x87, 0x85, 0x25, 0x84, 0x82,
	0x0A, 0x0B, 0x14, 0x05, 0x11, 0x97, 0x0F, 0x05, 0x16, 0x0F, 0x21, 0x0B, 0x8F, 0x8C, 0x8B, 0x84,
	0x91, 0x18, 0x22, 0x2F, 0x20, 0x2E, 0xAD, 0x26, 0x0F, 0x37, 0x9D, 0x35, 0x8F, 0x8C, 0x0B, 0x84,
	0x14, 0x0F, 0x21, 0x8B, 0x22, 0xAD, 0x9D, 0x0B, 0x21, 0x9D, 0x9E, 0x8F, 0x1D, 0x90, 0x8F, 0x85,
	0x8F, 0x36, 0x1D, 0xB5, 0x2D, 0x28, 0x90, 0x87, 0x0B, 0x35, 0x8F, 0x34, 0x8B, 0x07, 0x85, 0x81,
	0x8B, 0x0B, 0x8F, 0x85, 0x98, 0x2B, 0x36, 0x85, 0x8F, 0x8F, 0x1D, 0x8B, 0xB7, 0x0C, 0xB5, 0x04,
	0x17, 0xAB, 0x2D, 0xA6, 0xAE, 0x2A, 0x28, 0x25, 0x8C, 0x8C, 0x90, 0x07, 0x0C, 0x89, 0x87, 0x82,
	0x05, 0x05, 0x0B, 0x84, 0x2F, 0x26, 0x35, 0x84, 0x8B, 0x0B, 0x8F, 0x85, 0xB5, 0x87, 0x34, 0x81,
	0x85, 0x85, 0x8B, 0x04, 0xA6, 0x25, 0x07, 0x82, 0x84, 0x84, 0x85, 0x81, 0x04, 0x82, 0x81, 0x80
};
// clang-format on
inline unsigned char get_transition_cell_class(unsigned int i) {
#ifdef DEBUG_ENABLED
	CRASH_COND(i >= 512);
#endif
	return transitionCellClass[i];
}

// The transitionCellData table holds the triangulation data for all 56 distinct classes to
// which a case can be mapped by the transitionCellClass table. The class index should be ANDed
// with 0x7F before using it to look up triangulation data in this table.
// clang-format off
const TransitionCellData transitionCellData[56] = {
	{ 0x00, {} },
	{ 0x42, { 0, 1, 3, 1, 2, 3 } },
	{ 0x31, { 0, 1, 2 } },
	{ 0x42, { 0, 1, 2, 0, 2, 3 } },
	{ 0x53, { 0, 1, 4, 1, 3, 4, 1, 2, 3 } },
	{ 0x64, { 0, 1, 5, 1, 2, 5, 2, 4, 5, 2, 3, 4 } },
	{ 0x84, { 0, 1, 3, 1, 2, 3, 4, 5, 6, 4, 6, 7 } },
	{ 0x73, { 0, 1, 3, 1, 2, 3, 4, 5, 6 } },
	{ 0x84, { 0, 1, 3, 1, 2, 3, 4, 5, 7, 5, 6, 7 } },
	{ 0x62, { 0, 1, 2, 3, 4, 5 } },
	{ 0x53, { 0, 1, 3, 0, 3, 4, 1, 2, 3 } },
	{ 0x75, { 0, 1, 6, 1, 2, 6, 2, 5, 6, 2, 3, 5, 3, 4, 5 } },
	{ 0x84, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 5, 6, 7 } },
	{ 0x95, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 5, 6, 8, 6, 7, 8 } },
	{ 0xA6, { 0, 1, 5, 1, 2, 5, 2, 4, 5, 2, 3, 4, 6, 7, 8, 6, 8, 9 } },
	{ 0x86, { 0, 1, 7, 1, 2, 7, 2, 3, 7, 3, 6, 7, 3, 4, 6, 4, 5, 6 } },
	{ 0x95, { 0, 1, 5, 1, 2, 5, 2, 4, 5, 2, 3, 4, 6, 7, 8 } },
	{ 0x95, { 0, 1, 3, 1, 2, 3, 4, 5, 7, 4, 7, 8, 5, 6, 7 } },
	{ 0xA4, { 0, 1, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
	{ 0xC6, { 0, 1, 3, 1, 2, 3, 4, 5, 7, 5, 6, 7, 8, 9, 10, 8, 10, 11 } },
	{ 0x64, { 0, 1, 3, 1, 2, 3, 0, 3, 4, 0, 4, 5 } },
	{ 0x93, { 0, 1, 2, 3, 4, 5, 6, 7, 8 } },
	{ 0x64, { 0, 1, 4, 0, 4, 5, 1, 3, 4, 1, 2, 3 } },
	{ 0x97, { 0, 1, 8, 1, 7, 8, 1, 2, 7, 2, 3, 7, 3, 4, 7, 4, 5, 7, 5, 6, 7 } },
	{ 0xB7, { 0, 1, 6, 1, 2, 6, 2, 5, 6, 2, 3, 5, 3, 4, 5, 7, 8, 10, 8, 9, 10 } },
	{ 0xA6, { 0, 1, 6, 1, 2, 6, 2, 5, 6, 2, 3, 5, 3, 4, 5, 7, 8, 9 } },
	{ 0xB5, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 5, 6, 7, 8, 9, 10 } },
	{ 0xA6, { 0, 1, 5, 1, 2, 5, 2, 4, 5, 2, 3, 4, 6, 7, 9, 7, 8, 9 } },
	{ 0xA6, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 5, 6, 9, 6, 8, 9, 6, 7, 8 } },
	{ 0x97, { 0, 1, 8, 1, 2, 8, 2, 3, 8, 3, 7, 8, 3, 4, 7, 4, 5, 7, 5, 6, 7 } },
	{ 0x86, { 0, 1, 7, 1, 6, 7, 1, 2, 6, 2, 5, 6, 2, 4, 5, 2, 3, 4 } },
	{ 0xC8, { 0, 1, 7, 1, 2, 7, 2, 3, 7, 3, 6, 7, 3, 4, 6, 4, 5, 6, 8, 9, 10, 8, 10, 11 } },
	{ 0xB7, { 0, 1, 5, 1, 2, 5, 2, 4, 5, 2, 3, 4, 6, 9, 10, 6, 7, 9, 7, 8, 9 } },
	{ 0x75, { 0, 1, 6, 1, 3, 6, 1, 2, 3, 3, 4, 6, 4, 5, 6 } },
	{ 0xA6, { 0, 1, 3, 1, 2, 3, 4, 5, 9, 5, 8, 9, 5, 6, 8, 6, 7, 8 } },
	{ 0xC4, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
	{ 0x86, { 1, 2, 4, 2, 3, 4, 0, 1, 7, 1, 4, 7, 4, 6, 7, 4, 5, 6 } },
	{ 0x64, { 0, 4, 5, 0, 1, 4, 1, 3, 4, 1, 2, 3 } },
	{ 0x86, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 0, 4, 7, 4, 6, 7, 4, 5, 6 } },
	{ 0x97, { 1, 2, 3, 1, 3, 4, 1, 4, 5, 0, 1, 8, 1, 5, 8, 5, 7, 8, 5, 6, 7 } },
	{ 0xA6, { 0, 1, 3, 1, 2, 3, 4, 5, 9, 5, 8, 9, 5, 6, 8, 6, 7, 8 } },
	{ 0xC8, { 0, 1, 5, 1, 2, 5, 2, 4, 5, 2, 3, 4, 6, 7, 11, 7, 10, 11, 7, 8, 10, 8, 9, 10 } },
	{ 0x97, { 0, 1, 8, 1, 2, 8, 2, 7, 8, 2, 3, 7, 3, 6, 7, 3, 4, 6, 4, 5, 6 } },
	{ 0x97, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 0, 4, 8, 4, 7, 8, 4, 5, 7, 5, 6, 7 } },
	{ 0xB7, { 0, 1, 5, 1, 2, 5, 2, 4, 5, 2, 3, 4, 6, 7, 10, 7, 9, 10, 7, 8, 9 } },
	{ 0xA8, { 0, 1, 9, 1, 2, 9, 2, 8, 9, 2, 3, 8, 3, 7, 8, 3, 4, 7, 4, 6, 7, 4, 5, 6 } },
	{ 0xB9, { 0, 1, 7, 1, 6, 7, 1, 2, 6, 2, 5, 6, 2, 3, 5, 3, 4, 5, 0, 7, 10, 7, 9, 10, 7, 8, 9 } },
	{ 0xA6, { 0, 1, 5, 1, 4, 5, 1, 2, 4, 2, 3, 4, 6, 7, 9, 7, 8, 9 } },
	{ 0xC6, { 0, 1, 5, 1, 2, 5, 2, 4, 5, 2, 3, 4, 6, 7, 8, 9, 10, 11 } },
	{ 0xB7, { 0, 1, 7, 1, 2, 7, 2, 3, 7, 3, 6, 7, 3, 4, 6, 4, 5, 6, 8, 9, 10 } },
	{ 0xA8, { 1, 2, 3, 1, 3, 4, 1, 4, 6, 4, 5, 6, 0, 1, 9, 1, 6, 9, 6, 8, 9, 6, 7, 8 } },
	{ 0xCC, { 0, 1, 9, 1, 8, 9, 1, 2, 8, 2, 11, 8, 2, 3, 11, 3, 4, 11, 4, 5, 11, 5, 10, 11, 5, 6, 10, 6, 9, 10, 6, 7, 9, 7, 0, 9 } },
	{ 0x86, { 0, 1, 2, 0, 2, 3, 0, 6, 7, 0, 3, 6, 1, 4, 5, 1, 5, 2 } },
	{ 0x97, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 2, 5, 6, 2, 6, 3, 0, 7, 8, 0, 4, 7 } },
	{ 0xA8, { 0, 1, 5, 1, 4, 5, 1, 2, 4, 2, 3, 4, 3, 6, 7, 3, 7, 4, 0, 8, 9, 0, 5, 8 } },
	{ 0xA8, { 0, 1, 5, 1, 4, 5, 1, 2, 4, 2, 3, 4, 2, 6, 3, 3, 6, 7, 0, 8, 9, 0, 5, 8 } }
};
// clang-format on
inline const TransitionCellData &get_transition_cell_data(unsigned int i) {
#ifdef DEBUG_ENABLED
	CRASH_COND(i >= 56);
#endif
	return transitionCellData[i];
}

// The transitionCornerData table contains the transition cell corner reuse data
// shown in Figure 4.18.
// clang-format off
const unsigned char transitionCornerData[13] = {
	0x30, 0x21, 0x20, 0x12, 0x40, 0x82, 0x10, 0x81, 0x80, 0x37, 0x27, 0x17, 0x87
};
// clang-format on
inline unsigned char get_transition_corner_data(unsigned int i) {
#ifdef DEBUG_ENABLED
	CRASH_COND(i >= 13);
#endif
	return transitionCornerData[i];
}

// The transitionVertexData table gives the vertex locations for every one of the 512 possible
// cases in the Tranvoxel Algorithm. Each 16-bit value also provides information about whether
// a vertex can be reused from a neighboring cell. See Section 4.5 for details. The low byte
// contains the indexes for the two endpoints of the edge on which the vertex lies, as numbered
// in Figure 4.16. The high byte contains the vertex reuse data shown in Figure 4.17.
// clang-format off
const unsigned short transitionVertexData[512][12] = {
	{},
	{ 0x2301, 0x1503, 0x199B, 0x289A },
	{ 0x2301, 0x2412, 0x4514 },
	{ 0x1503, 0x4514, 0x2412, 0x289A, 0x199B },
	{ 0x8525, 0x2412, 0x289A, 0x89AC },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC },
	{ 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC },
	{ 0x8525, 0x4514, 0x1503, 0x199B, 0x89AC },
	{ 0x8525, 0x8658, 0x4445 },
	{ 0x1503, 0x2301, 0x289A, 0x199B, 0x8658, 0x8525, 0x4445 },
	{ 0x8525, 0x8658, 0x4445, 0x2301, 0x2412, 0x4514 },
	{ 0x1503, 0x4514, 0x2412, 0x289A, 0x199B, 0x8658, 0x8525, 0x4445 },
	{ 0x2412, 0x4445, 0x8658, 0x89AC, 0x289A },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC },
	{ 0x8658, 0x4445, 0x4514, 0x2301, 0x289A, 0x89AC },
	{ 0x8658, 0x4445, 0x4514, 0x1503, 0x199B, 0x89AC },
	{ 0x8478, 0x8658, 0x89AC, 0x88BC },
	{ 0x2301, 0x1503, 0x199B, 0x289A, 0x8478, 0x8658, 0x89AC, 0x88BC },
	{ 0x8478, 0x8658, 0x89AC, 0x88BC, 0x2301, 0x2412, 0x4514 },
	{ 0x1503, 0x4514, 0x2412, 0x289A, 0x199B, 0x8658, 0x8478, 0x88BC, 0x89AC },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x2301, 0x1503, 0x199B, 0x88BC },
	{ 0x2301, 0x4514, 0x8525, 0x8658, 0x8478, 0x88BC, 0x289A },
	{ 0x8478, 0x8658, 0x8525, 0x4514, 0x1503, 0x199B, 0x88BC },
	{ 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC },
	{ 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x2301, 0x1503, 0x199B, 0x289A },
	{ 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x2301, 0x2412, 0x4514 },
	{ 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x2412, 0x4514, 0x1503, 0x199B, 0x289A },
	{ 0x8478, 0x4445, 0x2412, 0x289A, 0x88BC },
	{ 0x1503, 0x2301, 0x2412, 0x4445, 0x8478, 0x88BC, 0x199B },
	{ 0x2301, 0x4514, 0x4445, 0x8478, 0x88BC, 0x289A },
	{ 0x1503, 0x4514, 0x4445, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x8367, 0x4647 },
	{ 0x2301, 0x1503, 0x199B, 0x289A, 0x8478, 0x8367, 0x4647 },
	{ 0x2301, 0x2412, 0x4514, 0x8478, 0x8367, 0x4647 },
	{ 0x1503, 0x4514, 0x2412, 0x289A, 0x199B, 0x8367, 0x8478, 0x4647 },
	{ 0x2412, 0x8525, 0x89AC, 0x289A, 0x8367, 0x8478, 0x4647 },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x8525, 0x4514, 0x1503, 0x199B, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x8478, 0x8367, 0x4647, 0x8525, 0x8658, 0x4445 },
	{ 0x2301, 0x1503, 0x199B, 0x289A, 0x8478, 0x8367, 0x4647, 0x8525, 0x8658, 0x4445 },
	{ 0x8478, 0x8367, 0x4647, 0x8525, 0x8658, 0x4445, 0x2301, 0x2412, 0x4514 },
	{ 0x1503, 0x4514, 0x2412, 0x289A, 0x199B, 0x8658, 0x8525, 0x4445, 0x8367, 0x8478, 0x4647 },
	{ 0x2412, 0x4445, 0x8658, 0x89AC, 0x289A, 0x8367, 0x8478, 0x4647 },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x2301, 0x4514, 0x4445, 0x8658, 0x89AC, 0x289A, 0x8367, 0x8478, 0x4647 },
	{ 0x8658, 0x4445, 0x4514, 0x1503, 0x199B, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x8658, 0x4647, 0x8367, 0x88BC, 0x89AC },
	{ 0x8658, 0x4647, 0x8367, 0x88BC, 0x89AC, 0x1503, 0x2301, 0x289A, 0x199B },
	{ 0x8658, 0x4647, 0x8367, 0x88BC, 0x89AC, 0x2412, 0x2301, 0x4514 },
	{ 0x1503, 0x4514, 0x2412, 0x289A, 0x199B, 0x8658, 0x4647, 0x8367, 0x88BC, 0x89AC },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC },
	{ 0x1503, 0x2301, 0x2412, 0x8525, 0x8658, 0x4647, 0x8367, 0x88BC, 0x199B },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x4514, 0x2301, 0x289A, 0x88BC },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x4514, 0x1503, 0x199B, 0x88BC },
	{ 0x8367, 0x4647, 0x4445, 0x8525, 0x89AC, 0x88BC },
	{ 0x8367, 0x4647, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x2301, 0x1503, 0x199B, 0x289A },
	{ 0x8367, 0x4647, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x2301, 0x2412, 0x4514 },
	{ 0x8525, 0x4445, 0x4647, 0x8367, 0x88BC, 0x89AC, 0x1503, 0x4514, 0x2412, 0x289A, 0x199B },
	{ 0x8367, 0x4647, 0x4445, 0x2412, 0x289A, 0x88BC },
	{ 0x8367, 0x4647, 0x4445, 0x2412, 0x2301, 0x1503, 0x199B, 0x88BC },
	{ 0x2301, 0x4514, 0x4445, 0x4647, 0x8367, 0x88BC, 0x289A },
	{ 0x8367, 0x4647, 0x4445, 0x4514, 0x1503, 0x199B, 0x88BC },
	{ 0x1636, 0x8367, 0x88BC, 0x199B },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A },
	{ 0x8367, 0x1636, 0x199B, 0x88BC, 0x2412, 0x2301, 0x4514 },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A },
	{ 0x8525, 0x2412, 0x289A, 0x89AC, 0x1636, 0x8367, 0x88BC, 0x199B },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x1636, 0x8367, 0x88BC, 0x89AC },
	{ 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1636, 0x8367, 0x88BC, 0x199B },
	{ 0x8367, 0x1636, 0x1503, 0x4514, 0x8525, 0x89AC, 0x88BC },
	{ 0x1636, 0x8367, 0x88BC, 0x199B, 0x8525, 0x8658, 0x4445 },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x1636, 0x8367, 0x88BC, 0x199B, 0x8525, 0x8658, 0x4445, 0x2301, 0x2412, 0x4514 },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x2412, 0x4445, 0x8658, 0x89AC, 0x289A, 0x8367, 0x1636, 0x199B, 0x88BC },
	{ 0x8367, 0x1636, 0x1503, 0x2301, 0x2412, 0x4445, 0x8658, 0x89AC, 0x88BC },
	{ 0x8658, 0x4445, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1636, 0x8367, 0x88BC, 0x199B },
	{ 0x8658, 0x4445, 0x4514, 0x1503, 0x1636, 0x8367, 0x88BC, 0x89AC },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x8478, 0x8658, 0x89AC, 0x289A },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x8658, 0x8478, 0x8367, 0x1636, 0x1503, 0x4514, 0x2412, 0x289A, 0x89AC },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x2412, 0x289A, 0x199B },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x2412, 0x2301, 0x1503 },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x4514, 0x2301, 0x289A, 0x199B },
	{ 0x1503, 0x4514, 0x8525, 0x8658, 0x8478, 0x8367, 0x1636 },
	{ 0x8525, 0x4445, 0x8478, 0x8367, 0x1636, 0x199B, 0x89AC },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x8478, 0x4445, 0x8525, 0x89AC, 0x289A },
	{ 0x8525, 0x4445, 0x8478, 0x8367, 0x1636, 0x199B, 0x89AC, 0x2412, 0x2301, 0x4514 },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x8367, 0x8478, 0x4445, 0x8525, 0x89AC, 0x289A },
	{ 0x1636, 0x8367, 0x8478, 0x4445, 0x2412, 0x289A, 0x199B },
	{ 0x2412, 0x4445, 0x8478, 0x8367, 0x1636, 0x1503, 0x2301 },
	{ 0x2301, 0x4514, 0x4445, 0x8478, 0x8367, 0x1636, 0x199B, 0x289A },
	{ 0x8367, 0x1636, 0x1503, 0x4514, 0x4445, 0x8478 },
	{ 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x4647, 0x1636, 0x1503, 0x2301, 0x289A, 0x88BC },
	{ 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x4647, 0x8478, 0x88BC, 0x289A },
	{ 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B, 0x8525, 0x2412, 0x289A, 0x89AC },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x1636, 0x4647, 0x8478, 0x88BC, 0x89AC },
	{ 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x4647, 0x1636, 0x1503, 0x4514, 0x8525, 0x89AC, 0x88BC },
	{ 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B, 0x8525, 0x8658, 0x4445 },
	{ 0x8478, 0x4647, 0x1636, 0x1503, 0x2301, 0x289A, 0x88BC, 0x8658, 0x8525, 0x4445 },
	{ 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B, 0x8525, 0x8658, 0x4445, 0x2301, 0x2412, 0x4514 },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x4647, 0x8478, 0x88BC, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B, 0x8658, 0x4445, 0x2412, 0x289A, 0x89AC },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x1503, 0x1636, 0x4647, 0x8478, 0x88BC, 0x89AC },
	{ 0x8658, 0x4445, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x4647, 0x1636, 0x1503, 0x4514, 0x4445, 0x8658, 0x89AC, 0x88BC },
	{ 0x1636, 0x4647, 0x8658, 0x89AC, 0x199B },
	{ 0x2301, 0x1503, 0x1636, 0x4647, 0x8658, 0x89AC, 0x289A },
	{ 0x1636, 0x4647, 0x8658, 0x89AC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x4647, 0x8658, 0x89AC, 0x289A },
	{ 0x2412, 0x8525, 0x8658, 0x4647, 0x1636, 0x199B, 0x289A },
	{ 0x8658, 0x4647, 0x1636, 0x1503, 0x2301, 0x2412, 0x8525 },
	{ 0x2301, 0x4514, 0x8525, 0x8658, 0x4647, 0x1636, 0x199B, 0x289A },
	{ 0x1503, 0x4514, 0x8525, 0x8658, 0x4647, 0x1636 },
	{ 0x8525, 0x4445, 0x4647, 0x1636, 0x199B, 0x89AC },
	{ 0x8525, 0x4445, 0x4647, 0x1636, 0x1503, 0x2301, 0x289A, 0x89AC },
	{ 0x8525, 0x4445, 0x4647, 0x1636, 0x199B, 0x89AC, 0x2412, 0x2301, 0x4514 },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x4647, 0x4445, 0x8525, 0x89AC, 0x289A },
	{ 0x2412, 0x4445, 0x4647, 0x1636, 0x199B, 0x289A },
	{ 0x1503, 0x2301, 0x2412, 0x4445, 0x4647, 0x1636 },
	{ 0x2301, 0x4514, 0x4445, 0x4647, 0x1636, 0x199B, 0x289A },
	{ 0x1503, 0x4514, 0x4445, 0x4647, 0x1636 },
	{ 0x1636, 0x1503, 0x4334 },
	{ 0x2301, 0x4334, 0x1636, 0x199B, 0x289A },
	{ 0x2301, 0x2412, 0x4514, 0x1636, 0x1503, 0x4334 },
	{ 0x2412, 0x4514, 0x4334, 0x1636, 0x199B, 0x289A },
	{ 0x8525, 0x2412, 0x289A, 0x89AC, 0x1636, 0x1503, 0x4334 },
	{ 0x1636, 0x4334, 0x2301, 0x2412, 0x8525, 0x89AC, 0x199B },
	{ 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1636, 0x1503, 0x4334 },
	{ 0x1636, 0x4334, 0x4514, 0x8525, 0x89AC, 0x199B },
	{ 0x1636, 0x1503, 0x4334, 0x8525, 0x8658, 0x4445 },
	{ 0x2301, 0x4334, 0x1636, 0x199B, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x8525, 0x8658, 0x4445, 0x2301, 0x2412, 0x4514, 0x1636, 0x1503, 0x4334 },
	{ 0x1636, 0x4334, 0x4514, 0x2412, 0x289A, 0x199B, 0x8658, 0x8525, 0x4445 },
	{ 0x2412, 0x4445, 0x8658, 0x89AC, 0x289A, 0x1503, 0x1636, 0x4334 },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x4334, 0x1636, 0x199B, 0x89AC },
	{ 0x8658, 0x4445, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1636, 0x1503, 0x4334 },
	{ 0x1636, 0x4334, 0x4514, 0x4445, 0x8658, 0x89AC, 0x199B },
	{ 0x8658, 0x8478, 0x88BC, 0x89AC, 0x1503, 0x1636, 0x4334 },
	{ 0x2301, 0x4334, 0x1636, 0x199B, 0x289A, 0x8478, 0x8658, 0x89AC, 0x88BC },
	{ 0x8478, 0x8658, 0x89AC, 0x88BC, 0x2301, 0x2412, 0x4514, 0x1636, 0x1503, 0x4334 },
	{ 0x2412, 0x4514, 0x4334, 0x1636, 0x199B, 0x289A, 0x8478, 0x8658, 0x89AC, 0x88BC },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x2301, 0x4334, 0x1636, 0x199B, 0x88BC },
	{ 0x2301, 0x4514, 0x8525, 0x8658, 0x8478, 0x88BC, 0x289A, 0x1503, 0x1636, 0x4334 },
	{ 0x1636, 0x4334, 0x4514, 0x8525, 0x8658, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x2301, 0x4334, 0x1636, 0x199B, 0x289A, 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC },
	{ 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x2301, 0x2412, 0x4514, 0x1636, 0x1503, 0x4334 },
	{ 0x2412, 0x4514, 0x4334, 0x1636, 0x199B, 0x289A, 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC },
	{ 0x8478, 0x4445, 0x2412, 0x289A, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x1636, 0x4334, 0x2301, 0x2412, 0x4445, 0x8478, 0x88BC, 0x199B },
	{ 0x2301, 0x4514, 0x4445, 0x8478, 0x88BC, 0x289A, 0x1503, 0x1636, 0x4334 },
	{ 0x1636, 0x4334, 0x4514, 0x4445, 0x8478, 0x88BC, 0x199B },
	{ 0x1636, 0x1503, 0x4334, 0x8478, 0x8367, 0x4647 },
	{ 0x2301, 0x4334, 0x1636, 0x199B, 0x289A, 0x8478, 0x8367, 0x4647 },
	{ 0x2301, 0x2412, 0x4514, 0x1636, 0x1503, 0x4334, 0x8478, 0x8367, 0x4647 },
	{ 0x2412, 0x4514, 0x4334, 0x1636, 0x199B, 0x289A, 0x8478, 0x8367, 0x4647 },
	{ 0x8525, 0x2412, 0x289A, 0x89AC, 0x1636, 0x1503, 0x4334, 0x8478, 0x8367, 0x4647 },
	{ 0x1636, 0x4334, 0x2301, 0x2412, 0x8525, 0x89AC, 0x199B, 0x8367, 0x8478, 0x4647 },
	{ 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1636, 0x1503, 0x4334, 0x8478, 0x8367, 0x4647 },
	{ 0x1636, 0x4334, 0x4514, 0x8525, 0x89AC, 0x199B, 0x8367, 0x8478, 0x4647 },
	{ 0x1636, 0x1503, 0x4334, 0x8478, 0x8367, 0x4647, 0x8525, 0x8658, 0x4445 },
	{ 0x2301, 0x4334, 0x1636, 0x199B, 0x289A, 0x8478, 0x8367, 0x4647, 0x8525, 0x8658, 0x4445 },
	{ 0x2301, 0x2412, 0x4514, 0x1636, 0x1503, 0x4334, 0x8478, 0x8367, 0x4647, 0x8525, 0x8658, 0x4445 },
	{ 0x2412, 0x4514, 0x4334, 0x1636, 0x199B, 0x289A, 0x8478, 0x8367, 0x4647, 0x8525, 0x8658, 0x4445 },
	{ 0x2412, 0x4445, 0x8658, 0x89AC, 0x289A, 0x8367, 0x8478, 0x4647, 0x1503, 0x1636, 0x4334 },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x4334, 0x1636, 0x199B, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x8658, 0x4445, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1636, 0x1503, 0x4334, 0x8478, 0x8367, 0x4647 },
	{ 0x8658, 0x4445, 0x4514, 0x4334, 0x1636, 0x199B, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x8658, 0x4647, 0x8367, 0x88BC, 0x89AC, 0x1503, 0x1636, 0x4334 },
	{ 0x2301, 0x4334, 0x1636, 0x199B, 0x289A, 0x8367, 0x4647, 0x8658, 0x89AC, 0x88BC },
	{ 0x8658, 0x4647, 0x8367, 0x88BC, 0x89AC, 0x1503, 0x1636, 0x4334, 0x2412, 0x2301, 0x4514 },
	{ 0x1636, 0x4334, 0x4514, 0x2412, 0x289A, 0x199B, 0x8658, 0x4647, 0x8367, 0x88BC, 0x89AC },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x2412, 0x2301, 0x4334, 0x1636, 0x199B, 0x88BC },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x4514, 0x2301, 0x289A, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x4514, 0x4334, 0x1636, 0x199B, 0x88BC },
	{ 0x8525, 0x4445, 0x4647, 0x8367, 0x88BC, 0x89AC, 0x1503, 0x1636, 0x4334 },
	{ 0x8367, 0x4647, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x2301, 0x4334, 0x1636, 0x199B, 0x289A },
	{ 0x8367, 0x4647, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x2301, 0x2412, 0x4514, 0x1636, 0x1503, 0x4334 },
	{ 0x8367, 0x4647, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x2412, 0x4514, 0x4334, 0x1636, 0x199B, 0x289A },
	{ 0x8367, 0x4647, 0x4445, 0x2412, 0x289A, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x1636, 0x4334, 0x2301, 0x2412, 0x4445, 0x4647, 0x8367, 0x88BC, 0x199B },
	{ 0x8367, 0x4647, 0x4445, 0x4514, 0x2301, 0x289A, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x8367, 0x4647, 0x4445, 0x4514, 0x4334, 0x1636, 0x199B, 0x88BC },
	{ 0x8367, 0x4334, 0x1503, 0x199B, 0x88BC },
	{ 0x2301, 0x4334, 0x8367, 0x88BC, 0x289A },
	{ 0x8367, 0x4334, 0x1503, 0x199B, 0x88BC, 0x2412, 0x2301, 0x4514 },
	{ 0x2412, 0x4514, 0x4334, 0x8367, 0x88BC, 0x289A },
	{ 0x8367, 0x4334, 0x1503, 0x199B, 0x88BC, 0x2412, 0x8525, 0x89AC, 0x289A },
	{ 0x8525, 0x2412, 0x2301, 0x4334, 0x8367, 0x88BC, 0x89AC },
	{ 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1503, 0x4334, 0x8367, 0x88BC, 0x199B },
	{ 0x8367, 0x4334, 0x4514, 0x8525, 0x89AC, 0x88BC },
	{ 0x8367, 0x4334, 0x1503, 0x199B, 0x88BC, 0x8658, 0x8525, 0x4445 },
	{ 0x2301, 0x4334, 0x8367, 0x88BC, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x8367, 0x4334, 0x1503, 0x199B, 0x88BC, 0x2412, 0x2301, 0x4514, 0x8658, 0x8525, 0x4445 },
	{ 0x2412, 0x4514, 0x4334, 0x8367, 0x88BC, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x2412, 0x4445, 0x8658, 0x89AC, 0x289A, 0x8367, 0x4334, 0x1503, 0x199B, 0x88BC },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x4334, 0x8367, 0x88BC, 0x89AC },
	{ 0x2301, 0x4514, 0x4445, 0x8658, 0x89AC, 0x289A, 0x8367, 0x4334, 0x1503, 0x199B, 0x88BC },
	{ 0x8658, 0x4445, 0x4514, 0x4334, 0x8367, 0x88BC, 0x89AC },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B },
	{ 0x8658, 0x8478, 0x8367, 0x4334, 0x2301, 0x289A, 0x89AC },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x2412, 0x4514, 0x4334, 0x8367, 0x8478, 0x8658, 0x89AC, 0x289A },
	{ 0x2412, 0x8525, 0x8658, 0x8478, 0x8367, 0x4334, 0x1503, 0x199B, 0x289A },
	{ 0x8367, 0x4334, 0x2301, 0x2412, 0x8525, 0x8658, 0x8478 },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x8658, 0x8525, 0x4514, 0x2301, 0x289A, 0x199B },
	{ 0x8658, 0x8478, 0x8367, 0x4334, 0x4514, 0x8525 },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x4445, 0x8525, 0x89AC, 0x199B },
	{ 0x8525, 0x4445, 0x8478, 0x8367, 0x4334, 0x2301, 0x289A, 0x89AC },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x4445, 0x8525, 0x89AC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x8525, 0x4445, 0x8478, 0x8367, 0x4334, 0x4514, 0x2412, 0x289A, 0x89AC },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x4445, 0x2412, 0x289A, 0x199B },
	{ 0x8367, 0x4334, 0x2301, 0x2412, 0x4445, 0x8478 },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x4445, 0x4514, 0x2301, 0x289A, 0x199B },
	{ 0x8367, 0x4334, 0x4514, 0x4445, 0x8478 },
	{ 0x1503, 0x4334, 0x4647, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x4647, 0x4334, 0x2301, 0x289A, 0x88BC },
	{ 0x8478, 0x4647, 0x4334, 0x1503, 0x199B, 0x88BC, 0x2412, 0x2301, 0x4514 },
	{ 0x8478, 0x4647, 0x4334, 0x4514, 0x2412, 0x289A, 0x88BC },
	{ 0x1503, 0x4334, 0x4647, 0x8478, 0x88BC, 0x199B, 0x8525, 0x2412, 0x289A, 0x89AC },
	{ 0x8478, 0x4647, 0x4334, 0x2301, 0x2412, 0x8525, 0x89AC, 0x88BC },
	{ 0x1503, 0x4334, 0x4647, 0x8478, 0x88BC, 0x199B, 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC },
	{ 0x8478, 0x4647, 0x4334, 0x4514, 0x8525, 0x89AC, 0x88BC },
	{ 0x1503, 0x4334, 0x4647, 0x8478, 0x88BC, 0x199B, 0x8525, 0x8658, 0x4445 },
	{ 0x8478, 0x4647, 0x4334, 0x2301, 0x289A, 0x88BC, 0x8658, 0x8525, 0x4445 },
	{ 0x1503, 0x4334, 0x4647, 0x8478, 0x88BC, 0x199B, 0x8525, 0x8658, 0x4445, 0x2301, 0x2412, 0x4514 },
	{ 0x2412, 0x4514, 0x4334, 0x4647, 0x8478, 0x88BC, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x8478, 0x4647, 0x4334, 0x1503, 0x199B, 0x88BC, 0x2412, 0x4445, 0x8658, 0x89AC, 0x289A },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x4334, 0x4647, 0x8478, 0x88BC, 0x89AC },
	{ 0x8658, 0x4445, 0x4514, 0x2301, 0x289A, 0x89AC, 0x1503, 0x4334, 0x4647, 0x8478, 0x88BC, 0x199B },
	{ 0x8658, 0x4445, 0x4514, 0x4334, 0x4647, 0x8478, 0x88BC, 0x89AC },
	{ 0x1503, 0x4334, 0x4647, 0x8658, 0x89AC, 0x199B },
	{ 0x8658, 0x4647, 0x4334, 0x2301, 0x289A, 0x89AC },
	{ 0x1503, 0x4334, 0x4647, 0x8658, 0x89AC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x2412, 0x4514, 0x4334, 0x4647, 0x8658, 0x89AC, 0x289A },
	{ 0x1503, 0x4334, 0x4647, 0x8658, 0x8525, 0x2412, 0x289A, 0x199B },
	{ 0x2412, 0x8525, 0x8658, 0x4647, 0x4334, 0x2301 },
	{ 0x2301, 0x4514, 0x8525, 0x8658, 0x4647, 0x4334, 0x1503, 0x199B, 0x289A },
	{ 0x8658, 0x4647, 0x4334, 0x4514, 0x8525 },
	{ 0x8525, 0x4445, 0x4647, 0x4334, 0x1503, 0x199B, 0x89AC },
	{ 0x8525, 0x4445, 0x4647, 0x4334, 0x2301, 0x289A, 0x89AC },
	{ 0x1503, 0x4334, 0x4647, 0x4445, 0x8525, 0x89AC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x2412, 0x4514, 0x4334, 0x4647, 0x4445, 0x8525, 0x89AC, 0x289A },
	{ 0x1503, 0x4334, 0x4647, 0x4445, 0x2412, 0x289A, 0x199B },
	{ 0x2412, 0x4445, 0x4647, 0x4334, 0x2301 },
	{ 0x1503, 0x4334, 0x4647, 0x4445, 0x4514, 0x2301, 0x289A, 0x199B },
	{ 0x4514, 0x4445, 0x4647, 0x4334 },
	{ 0x4514, 0x4445, 0x4647, 0x4334 },
	{ 0x2301, 0x1503, 0x199B, 0x289A, 0x4334, 0x4514, 0x4445, 0x4647 },
	{ 0x2412, 0x4445, 0x4647, 0x4334, 0x2301 },
	{ 0x1503, 0x4334, 0x4647, 0x4445, 0x2412, 0x289A, 0x199B },
	{ 0x8525, 0x2412, 0x289A, 0x89AC, 0x4514, 0x4445, 0x4647, 0x4334 },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC, 0x4514, 0x4445, 0x4647, 0x4334 },
	{ 0x8525, 0x4445, 0x4647, 0x4334, 0x2301, 0x289A, 0x89AC },
	{ 0x8525, 0x4445, 0x4647, 0x4334, 0x1503, 0x199B, 0x89AC },
	{ 0x8658, 0x4647, 0x4334, 0x4514, 0x8525 },
	{ 0x1503, 0x2301, 0x289A, 0x199B, 0x8525, 0x4514, 0x4334, 0x4647, 0x8658 },
	{ 0x2412, 0x8525, 0x8658, 0x4647, 0x4334, 0x2301 },
	{ 0x1503, 0x4334, 0x4647, 0x8658, 0x8525, 0x2412, 0x289A, 0x199B },
	{ 0x2412, 0x4514, 0x4334, 0x4647, 0x8658, 0x89AC, 0x289A },
	{ 0x8658, 0x4647, 0x4334, 0x4514, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC },
	{ 0x8658, 0x4647, 0x4334, 0x2301, 0x289A, 0x89AC },
	{ 0x1503, 0x4334, 0x4647, 0x8658, 0x89AC, 0x199B },
	{ 0x8478, 0x8658, 0x89AC, 0x88BC, 0x4445, 0x4647, 0x4334, 0x4514 },
	{ 0x2301, 0x1503, 0x199B, 0x289A, 0x8478, 0x8658, 0x89AC, 0x88BC, 0x4334, 0x4514, 0x4445, 0x4647 },
	{ 0x8478, 0x8658, 0x89AC, 0x88BC, 0x2412, 0x4445, 0x4647, 0x4334, 0x2301 },
	{ 0x1503, 0x4334, 0x4647, 0x4445, 0x2412, 0x289A, 0x199B, 0x8658, 0x8478, 0x88BC, 0x89AC },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC, 0x4445, 0x4647, 0x4334, 0x4514 },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x2301, 0x1503, 0x199B, 0x88BC, 0x4514, 0x4445, 0x4647, 0x4334 },
	{ 0x2301, 0x4334, 0x4647, 0x4445, 0x8525, 0x8658, 0x8478, 0x88BC, 0x289A },
	{ 0x8478, 0x8658, 0x8525, 0x4445, 0x4647, 0x4334, 0x1503, 0x199B, 0x88BC },
	{ 0x8478, 0x4647, 0x4334, 0x4514, 0x8525, 0x89AC, 0x88BC },
	{ 0x8478, 0x4647, 0x4334, 0x4514, 0x8525, 0x89AC, 0x88BC, 0x2301, 0x1503, 0x199B, 0x289A },
	{ 0x8478, 0x4647, 0x4334, 0x2301, 0x2412, 0x8525, 0x89AC, 0x88BC },
	{ 0x8478, 0x4647, 0x4334, 0x1503, 0x2412, 0x8525, 0x199B, 0x289A, 0x89AC, 0x88BC },
	{ 0x8478, 0x4647, 0x4334, 0x4514, 0x2412, 0x289A, 0x88BC },
	{ 0x1503, 0x2301, 0x2412, 0x4514, 0x4334, 0x4647, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x4647, 0x4334, 0x2301, 0x289A, 0x88BC },
	{ 0x1503, 0x4334, 0x4647, 0x8478, 0x88BC, 0x199B },
	{ 0x8367, 0x4334, 0x4514, 0x4445, 0x8478 },
	{ 0x2301, 0x1503, 0x199B, 0x289A, 0x8367, 0x4334, 0x4514, 0x4445, 0x8478 },
	{ 0x8367, 0x4334, 0x2301, 0x2412, 0x4445, 0x8478 },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x4445, 0x2412, 0x289A, 0x199B },
	{ 0x2412, 0x8525, 0x89AC, 0x289A, 0x8478, 0x4445, 0x4514, 0x4334, 0x8367 },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC, 0x8367, 0x4334, 0x4514, 0x4445, 0x8478 },
	{ 0x8525, 0x4445, 0x8478, 0x8367, 0x4334, 0x2301, 0x289A, 0x89AC },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x4445, 0x8525, 0x89AC, 0x199B },
	{ 0x8658, 0x8478, 0x8367, 0x4334, 0x4514, 0x8525 },
	{ 0x2301, 0x1503, 0x199B, 0x289A, 0x8367, 0x4334, 0x4514, 0x8525, 0x8658, 0x8478 },
	{ 0x8367, 0x4334, 0x2301, 0x2412, 0x8525, 0x8658, 0x8478 },
	{ 0x2412, 0x8525, 0x8658, 0x8478, 0x8367, 0x4334, 0x1503, 0x199B, 0x289A },
	{ 0x2412, 0x4514, 0x4334, 0x8367, 0x8478, 0x8658, 0x89AC, 0x289A },
	{ 0x8658, 0x8478, 0x8367, 0x4334, 0x4514, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC },
	{ 0x8658, 0x8478, 0x8367, 0x4334, 0x2301, 0x289A, 0x89AC },
	{ 0x1503, 0x4334, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B },
	{ 0x8658, 0x4445, 0x4514, 0x4334, 0x8367, 0x88BC, 0x89AC },
	{ 0x8658, 0x4445, 0x4514, 0x4334, 0x8367, 0x88BC, 0x89AC, 0x1503, 0x2301, 0x289A, 0x199B },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x4334, 0x8367, 0x88BC, 0x89AC },
	{ 0x8658, 0x4445, 0x2412, 0x1503, 0x4334, 0x8367, 0x289A, 0x199B, 0x88BC, 0x89AC },
	{ 0x8367, 0x4334, 0x4514, 0x4445, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC },
	{ 0x1503, 0x2301, 0x2412, 0x8525, 0x8658, 0x4445, 0x4514, 0x4334, 0x8367, 0x88BC, 0x199B },
	{ 0x2301, 0x4334, 0x8367, 0x88BC, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x8367, 0x4334, 0x1503, 0x199B, 0x88BC, 0x8658, 0x8525, 0x4445 },
	{ 0x8367, 0x4334, 0x4514, 0x8525, 0x89AC, 0x88BC },
	{ 0x8367, 0x4334, 0x4514, 0x8525, 0x89AC, 0x88BC, 0x2301, 0x1503, 0x199B, 0x289A },
	{ 0x8525, 0x2412, 0x2301, 0x4334, 0x8367, 0x88BC, 0x89AC },
	{ 0x1503, 0x4334, 0x8367, 0x8525, 0x2412, 0x88BC, 0x89AC, 0x289A, 0x199B },
	{ 0x2412, 0x4514, 0x4334, 0x8367, 0x88BC, 0x289A },
	{ 0x1503, 0x2301, 0x2412, 0x4514, 0x4334, 0x8367, 0x88BC, 0x199B },
	{ 0x2301, 0x4334, 0x8367, 0x88BC, 0x289A },
	{ 0x8367, 0x4334, 0x1503, 0x199B, 0x88BC },
	{ 0x1636, 0x8367, 0x88BC, 0x199B, 0x4647, 0x4334, 0x4514, 0x4445 },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A, 0x4334, 0x4514, 0x4445, 0x4647 },
	{ 0x8367, 0x1636, 0x199B, 0x88BC, 0x2301, 0x4334, 0x4647, 0x4445, 0x2412 },
	{ 0x2412, 0x4445, 0x4647, 0x4334, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A },
	{ 0x8525, 0x2412, 0x289A, 0x89AC, 0x1636, 0x8367, 0x88BC, 0x199B, 0x4514, 0x4445, 0x4647, 0x4334 },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x1636, 0x8367, 0x88BC, 0x89AC, 0x4334, 0x4514, 0x4445, 0x4647 },
	{ 0x8525, 0x4445, 0x4647, 0x4334, 0x2301, 0x289A, 0x89AC, 0x1636, 0x8367, 0x88BC, 0x199B },
	{ 0x8367, 0x1636, 0x1503, 0x4334, 0x4647, 0x4445, 0x8525, 0x89AC, 0x88BC },
	{ 0x1636, 0x8367, 0x88BC, 0x199B, 0x8658, 0x4647, 0x4334, 0x4514, 0x8525 },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A, 0x8658, 0x4647, 0x4334, 0x4514, 0x8525 },
	{ 0x1636, 0x8367, 0x88BC, 0x199B, 0x8658, 0x4647, 0x4334, 0x2301, 0x2412, 0x8525 },
	{ 0x2412, 0x8525, 0x8658, 0x4647, 0x4334, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A },
	{ 0x2412, 0x4514, 0x4334, 0x4647, 0x8658, 0x89AC, 0x289A, 0x8367, 0x1636, 0x199B, 0x88BC },
	{ 0x8367, 0x1636, 0x1503, 0x2301, 0x2412, 0x4514, 0x4334, 0x4647, 0x8658, 0x89AC, 0x88BC },
	{ 0x8658, 0x4647, 0x4334, 0x2301, 0x289A, 0x89AC, 0x1636, 0x8367, 0x88BC, 0x199B },
	{ 0x8367, 0x1636, 0x1503, 0x4334, 0x4647, 0x8658, 0x89AC, 0x88BC },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B, 0x4647, 0x4334, 0x4514, 0x4445 },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x8478, 0x8658, 0x89AC, 0x289A, 0x4647, 0x4334, 0x4514, 0x4445 },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B, 0x2412, 0x4445, 0x4647, 0x4334, 0x2301 },
	{ 0x8658, 0x8478, 0x8367, 0x1636, 0x1503, 0x4334, 0x4647, 0x4445, 0x2412, 0x289A, 0x89AC },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x2412, 0x289A, 0x199B, 0x4445, 0x4647, 0x4334, 0x4514 },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x2412, 0x4334, 0x4514, 0x4445, 0x4647 },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x4445, 0x4647, 0x4334, 0x2301, 0x289A, 0x199B },
	{ 0x1503, 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x4445, 0x4647, 0x4334 },
	{ 0x8525, 0x4514, 0x4334, 0x4647, 0x8478, 0x8367, 0x1636, 0x199B, 0x89AC },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x8478, 0x4647, 0x4334, 0x4514, 0x8525, 0x89AC, 0x289A },
	{ 0x8525, 0x2412, 0x2301, 0x4334, 0x4647, 0x8478, 0x8367, 0x1636, 0x199B, 0x89AC },
	{ 0x2412, 0x8525, 0x89AC, 0x289A, 0x1503, 0x1636, 0x8367, 0x8478, 0x4647, 0x4334 },
	{ 0x1636, 0x8367, 0x8478, 0x4647, 0x4334, 0x4514, 0x2412, 0x289A, 0x199B },
	{ 0x2412, 0x2301, 0x1503, 0x1636, 0x8367, 0x8478, 0x4647, 0x4334, 0x4514 },
	{ 0x1636, 0x8367, 0x8478, 0x4647, 0x4334, 0x2301, 0x289A, 0x199B },
	{ 0x1636, 0x8367, 0x8478, 0x4647, 0x4334, 0x1503 },
	{ 0x1636, 0x4334, 0x4514, 0x4445, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x4445, 0x4514, 0x4334, 0x1636, 0x1503, 0x2301, 0x289A, 0x88BC },
	{ 0x1636, 0x4334, 0x2301, 0x2412, 0x4445, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x4445, 0x2412, 0x289A, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x1636, 0x4334, 0x4514, 0x4445, 0x8478, 0x88BC, 0x199B, 0x8525, 0x2412, 0x289A, 0x89AC },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x1636, 0x4334, 0x4514, 0x4445, 0x8478, 0x88BC, 0x89AC },
	{ 0x1636, 0x4334, 0x2301, 0x8525, 0x4445, 0x8478, 0x289A, 0x89AC, 0x88BC, 0x199B },
	{ 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x1636, 0x4334, 0x4514, 0x8525, 0x8658, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x8658, 0x8525, 0x4514, 0x4334, 0x1636, 0x1503, 0x2301, 0x289A, 0x88BC },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x2301, 0x4334, 0x1636, 0x199B, 0x88BC },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC, 0x1636, 0x1503, 0x4334 },
	{ 0x1636, 0x4334, 0x4514, 0x2412, 0x8658, 0x8478, 0x289A, 0x89AC, 0x88BC, 0x199B },
	{ 0x8658, 0x8478, 0x88BC, 0x89AC, 0x2412, 0x2301, 0x1503, 0x1636, 0x4334, 0x4514 },
	{ 0x1636, 0x4334, 0x2301, 0x8658, 0x8478, 0x289A, 0x89AC, 0x88BC, 0x199B },
	{ 0x8658, 0x8478, 0x88BC, 0x89AC, 0x1503, 0x1636, 0x4334 },
	{ 0x1636, 0x4334, 0x4514, 0x4445, 0x8658, 0x89AC, 0x199B },
	{ 0x2301, 0x1503, 0x1636, 0x4334, 0x4514, 0x4445, 0x8658, 0x89AC, 0x289A },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x4334, 0x1636, 0x199B, 0x89AC },
	{ 0x2412, 0x4445, 0x8658, 0x89AC, 0x289A, 0x1503, 0x1636, 0x4334 },
	{ 0x2412, 0x8525, 0x8658, 0x4445, 0x4514, 0x4334, 0x1636, 0x199B, 0x289A },
	{ 0x8658, 0x8525, 0x2412, 0x2301, 0x1503, 0x1636, 0x4334, 0x4514, 0x4445 },
	{ 0x2301, 0x4334, 0x1636, 0x199B, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x1636, 0x1503, 0x4334, 0x8525, 0x8658, 0x4445 },
	{ 0x1636, 0x4334, 0x4514, 0x8525, 0x89AC, 0x199B },
	{ 0x2301, 0x1503, 0x1636, 0x4334, 0x4514, 0x8525, 0x89AC, 0x289A },
	{ 0x1636, 0x4334, 0x2301, 0x2412, 0x8525, 0x89AC, 0x199B },
	{ 0x8525, 0x2412, 0x289A, 0x89AC, 0x1636, 0x1503, 0x4334 },
	{ 0x2412, 0x4514, 0x4334, 0x1636, 0x199B, 0x289A },
	{ 0x2301, 0x1503, 0x1636, 0x4334, 0x4514, 0x2412 },
	{ 0x2301, 0x4334, 0x1636, 0x199B, 0x289A },
	{ 0x1636, 0x1503, 0x4334 },
	{ 0x1503, 0x4514, 0x4445, 0x4647, 0x1636 },
	{ 0x2301, 0x4514, 0x4445, 0x4647, 0x1636, 0x199B, 0x289A },
	{ 0x1503, 0x2301, 0x2412, 0x4445, 0x4647, 0x1636 },
	{ 0x2412, 0x4445, 0x4647, 0x1636, 0x199B, 0x289A },
	{ 0x8525, 0x2412, 0x289A, 0x89AC, 0x1503, 0x4514, 0x4445, 0x4647, 0x1636 },
	{ 0x1636, 0x4647, 0x4445, 0x4514, 0x2301, 0x2412, 0x8525, 0x89AC, 0x199B },
	{ 0x8525, 0x4445, 0x4647, 0x1636, 0x1503, 0x2301, 0x289A, 0x89AC },
	{ 0x8525, 0x4445, 0x4647, 0x1636, 0x199B, 0x89AC },
	{ 0x1503, 0x4514, 0x8525, 0x8658, 0x4647, 0x1636 },
	{ 0x2301, 0x4514, 0x8525, 0x8658, 0x4647, 0x1636, 0x199B, 0x289A },
	{ 0x8658, 0x4647, 0x1636, 0x1503, 0x2301, 0x2412, 0x8525 },
	{ 0x2412, 0x8525, 0x8658, 0x4647, 0x1636, 0x199B, 0x289A },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x4647, 0x8658, 0x89AC, 0x289A },
	{ 0x1636, 0x4647, 0x8658, 0x89AC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x2301, 0x1503, 0x1636, 0x4647, 0x8658, 0x89AC, 0x289A },
	{ 0x1636, 0x4647, 0x8658, 0x89AC, 0x199B },
	{ 0x8658, 0x8478, 0x88BC, 0x89AC, 0x1636, 0x4647, 0x4445, 0x4514, 0x1503 },
	{ 0x2301, 0x4514, 0x4445, 0x4647, 0x1636, 0x199B, 0x289A, 0x8478, 0x8658, 0x89AC, 0x88BC },
	{ 0x8478, 0x8658, 0x89AC, 0x88BC, 0x2412, 0x4445, 0x4647, 0x1636, 0x1503, 0x2301 },
	{ 0x2412, 0x4445, 0x4647, 0x1636, 0x199B, 0x289A, 0x8478, 0x8658, 0x89AC, 0x88BC },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC, 0x1503, 0x4514, 0x4445, 0x4647, 0x1636 },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x2301, 0x4514, 0x4445, 0x4647, 0x1636, 0x199B, 0x88BC },
	{ 0x2301, 0x1503, 0x1636, 0x4647, 0x4445, 0x8525, 0x8658, 0x8478, 0x88BC, 0x289A },
	{ 0x8478, 0x8658, 0x8525, 0x4445, 0x4647, 0x1636, 0x199B, 0x88BC },
	{ 0x8478, 0x4647, 0x1636, 0x1503, 0x4514, 0x8525, 0x89AC, 0x88BC },
	{ 0x2301, 0x4514, 0x8525, 0x8478, 0x4647, 0x1636, 0x89AC, 0x88BC, 0x199B, 0x289A },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x1636, 0x4647, 0x8478, 0x88BC, 0x89AC },
	{ 0x8478, 0x4647, 0x1636, 0x2412, 0x8525, 0x199B, 0x289A, 0x89AC, 0x88BC },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x4647, 0x8478, 0x88BC, 0x289A },
	{ 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x8478, 0x4647, 0x1636, 0x1503, 0x2301, 0x289A, 0x88BC },
	{ 0x1636, 0x4647, 0x8478, 0x88BC, 0x199B },
	{ 0x8367, 0x1636, 0x1503, 0x4514, 0x4445, 0x8478 },
	{ 0x2301, 0x4514, 0x4445, 0x8478, 0x8367, 0x1636, 0x199B, 0x289A },
	{ 0x2412, 0x4445, 0x8478, 0x8367, 0x1636, 0x1503, 0x2301 },
	{ 0x1636, 0x8367, 0x8478, 0x4445, 0x2412, 0x289A, 0x199B },
	{ 0x8525, 0x2412, 0x289A, 0x89AC, 0x1503, 0x4514, 0x4445, 0x8478, 0x8367, 0x1636 },
	{ 0x1636, 0x8367, 0x8478, 0x4445, 0x4514, 0x2301, 0x2412, 0x8525, 0x89AC, 0x199B },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x8478, 0x4445, 0x8525, 0x89AC, 0x289A },
	{ 0x8525, 0x4445, 0x8478, 0x8367, 0x1636, 0x199B, 0x89AC },
	{ 0x1503, 0x4514, 0x8525, 0x8658, 0x8478, 0x8367, 0x1636 },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x4514, 0x2301, 0x289A, 0x199B },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x2412, 0x2301, 0x1503 },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x8525, 0x2412, 0x289A, 0x199B },
	{ 0x8658, 0x8478, 0x8367, 0x1636, 0x1503, 0x4514, 0x2412, 0x289A, 0x89AC },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B, 0x2301, 0x2412, 0x4514 },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x8478, 0x8658, 0x89AC, 0x289A },
	{ 0x1636, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B },
	{ 0x8658, 0x4445, 0x4514, 0x1503, 0x1636, 0x8367, 0x88BC, 0x89AC },
	{ 0x2301, 0x4514, 0x4445, 0x8658, 0x8367, 0x1636, 0x89AC, 0x88BC, 0x199B, 0x289A },
	{ 0x8367, 0x1636, 0x1503, 0x2301, 0x2412, 0x4445, 0x8658, 0x89AC, 0x88BC },
	{ 0x8658, 0x4445, 0x2412, 0x1636, 0x8367, 0x289A, 0x199B, 0x88BC, 0x89AC },
	{ 0x8367, 0x1636, 0x1503, 0x4514, 0x4445, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC },
	{ 0x8367, 0x1636, 0x199B, 0x88BC, 0x8658, 0x8525, 0x2412, 0x2301, 0x4514, 0x4445 },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A, 0x8525, 0x8658, 0x4445 },
	{ 0x1636, 0x8367, 0x88BC, 0x199B, 0x8525, 0x8658, 0x4445 },
	{ 0x8367, 0x1636, 0x1503, 0x4514, 0x8525, 0x89AC, 0x88BC },
	{ 0x2301, 0x4514, 0x8525, 0x8367, 0x1636, 0x89AC, 0x88BC, 0x199B, 0x289A },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x1636, 0x8367, 0x88BC, 0x89AC },
	{ 0x2412, 0x8525, 0x8367, 0x1636, 0x89AC, 0x88BC, 0x199B, 0x289A },
	{ 0x2412, 0x4514, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A },
	{ 0x8367, 0x1636, 0x199B, 0x88BC, 0x2412, 0x2301, 0x4514 },
	{ 0x2301, 0x1503, 0x1636, 0x8367, 0x88BC, 0x289A },
	{ 0x1636, 0x8367, 0x88BC, 0x199B },
	{ 0x8367, 0x4647, 0x4445, 0x4514, 0x1503, 0x199B, 0x88BC },
	{ 0x2301, 0x4514, 0x4445, 0x4647, 0x8367, 0x88BC, 0x289A },
	{ 0x8367, 0x4647, 0x4445, 0x2412, 0x2301, 0x1503, 0x199B, 0x88BC },
	{ 0x8367, 0x4647, 0x4445, 0x2412, 0x289A, 0x88BC },
	{ 0x8367, 0x4647, 0x4445, 0x4514, 0x1503, 0x199B, 0x88BC, 0x2412, 0x8525, 0x89AC, 0x289A },
	{ 0x8525, 0x2412, 0x2301, 0x4514, 0x4445, 0x4647, 0x8367, 0x88BC, 0x89AC },
	{ 0x8525, 0x4445, 0x4647, 0x8367, 0x1503, 0x2301, 0x88BC, 0x199B, 0x289A, 0x89AC },
	{ 0x8367, 0x4647, 0x4445, 0x8525, 0x89AC, 0x88BC },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x4514, 0x1503, 0x199B, 0x88BC },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x4514, 0x2301, 0x289A, 0x88BC },
	{ 0x1503, 0x2301, 0x2412, 0x8525, 0x8658, 0x4647, 0x8367, 0x88BC, 0x199B },
	{ 0x8367, 0x4647, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC },
	{ 0x2412, 0x4514, 0x1503, 0x8367, 0x4647, 0x8658, 0x199B, 0x88BC, 0x89AC, 0x289A },
	{ 0x8658, 0x4647, 0x8367, 0x88BC, 0x89AC, 0x2412, 0x2301, 0x4514 },
	{ 0x8367, 0x4647, 0x8658, 0x2301, 0x1503, 0x89AC, 0x289A, 0x199B, 0x88BC },
	{ 0x8658, 0x4647, 0x8367, 0x88BC, 0x89AC },
	{ 0x1503, 0x4514, 0x4445, 0x4647, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B },
	{ 0x8658, 0x8478, 0x8367, 0x4647, 0x4445, 0x4514, 0x2301, 0x289A, 0x89AC },
	{ 0x1503, 0x2301, 0x2412, 0x4445, 0x4647, 0x8367, 0x8478, 0x8658, 0x89AC, 0x199B },
	{ 0x8658, 0x8478, 0x8367, 0x4647, 0x4445, 0x2412, 0x289A, 0x89AC },
	{ 0x2412, 0x8525, 0x8658, 0x8478, 0x8367, 0x4647, 0x4445, 0x4514, 0x1503, 0x199B, 0x289A },
	{ 0x8367, 0x8478, 0x8658, 0x8525, 0x2412, 0x2301, 0x4514, 0x4445, 0x4647 },
	{ 0x1503, 0x2301, 0x289A, 0x199B, 0x8367, 0x8478, 0x8658, 0x8525, 0x4445, 0x4647 },
	{ 0x8478, 0x8658, 0x8525, 0x4445, 0x4647, 0x8367 },
	{ 0x8525, 0x4514, 0x1503, 0x199B, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC, 0x8478, 0x8367, 0x4647 },
	{ 0x2412, 0x8525, 0x89AC, 0x289A, 0x8367, 0x8478, 0x4647 },
	{ 0x1503, 0x4514, 0x2412, 0x289A, 0x199B, 0x8367, 0x8478, 0x4647 },
	{ 0x2301, 0x2412, 0x4514, 0x8478, 0x8367, 0x4647 },
	{ 0x2301, 0x1503, 0x199B, 0x289A, 0x8478, 0x8367, 0x4647 },
	{ 0x8478, 0x8367, 0x4647 },
	{ 0x1503, 0x4514, 0x4445, 0x8478, 0x88BC, 0x199B },
	{ 0x2301, 0x4514, 0x4445, 0x8478, 0x88BC, 0x289A },
	{ 0x1503, 0x2301, 0x2412, 0x4445, 0x8478, 0x88BC, 0x199B },
	{ 0x8478, 0x4445, 0x2412, 0x289A, 0x88BC },
	{ 0x1503, 0x4514, 0x4445, 0x8478, 0x88BC, 0x199B, 0x8525, 0x2412, 0x289A, 0x89AC },
	{ 0x8525, 0x2412, 0x2301, 0x4514, 0x4445, 0x8478, 0x88BC, 0x89AC },
	{ 0x8525, 0x4445, 0x8478, 0x1503, 0x2301, 0x88BC, 0x199B, 0x289A, 0x89AC },
	{ 0x8478, 0x4445, 0x8525, 0x89AC, 0x88BC },
	{ 0x8478, 0x8658, 0x8525, 0x4514, 0x1503, 0x199B, 0x88BC },
	{ 0x2301, 0x4514, 0x8525, 0x8658, 0x8478, 0x88BC, 0x289A },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x2301, 0x1503, 0x199B, 0x88BC },
	{ 0x8478, 0x8658, 0x8525, 0x2412, 0x289A, 0x88BC },
	{ 0x2412, 0x4514, 0x1503, 0x8478, 0x8658, 0x199B, 0x88BC, 0x89AC, 0x289A },
	{ 0x8478, 0x8658, 0x89AC, 0x88BC, 0x2301, 0x2412, 0x4514 },
	{ 0x1503, 0x2301, 0x8658, 0x8478, 0x289A, 0x89AC, 0x88BC, 0x199B },
	{ 0x8478, 0x8658, 0x89AC, 0x88BC },
	{ 0x8658, 0x4445, 0x4514, 0x1503, 0x199B, 0x89AC },
	{ 0x8658, 0x4445, 0x4514, 0x2301, 0x289A, 0x89AC },
	{ 0x8658, 0x4445, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC },
	{ 0x2412, 0x4445, 0x8658, 0x89AC, 0x289A },
	{ 0x2412, 0x8525, 0x8658, 0x4445, 0x4514, 0x1503, 0x199B, 0x289A },
	{ 0x8525, 0x2412, 0x2301, 0x4514, 0x4445, 0x8658 },
	{ 0x1503, 0x2301, 0x289A, 0x199B, 0x8658, 0x8525, 0x4445 },
	{ 0x8525, 0x8658, 0x4445 },
	{ 0x8525, 0x4514, 0x1503, 0x199B, 0x89AC },
	{ 0x8525, 0x4514, 0x2301, 0x289A, 0x89AC },
	{ 0x8525, 0x2412, 0x2301, 0x1503, 0x199B, 0x89AC },
	{ 0x8525, 0x2412, 0x289A, 0x89AC },
	{ 0x1503, 0x4514, 0x2412, 0x289A, 0x199B },
	{ 0x2301, 0x2412, 0x4514 },
	{ 0x2301, 0x1503, 0x199B, 0x289A },
	{}
};
// clang-format on
inline unsigned short get_transition_vertex_data(unsigned int i, unsigned int j) {
#ifdef DEBUG_ENABLED
	CRASH_COND(i >= 512);
	CRASH_COND(j >= 12);
#endif
	return transitionVertexData[i][j];
}

} // namespace zylann::voxel::transvoxel::tables
